1.从github上git clone下来一个工程,Clone with HTTPS(不是ssh模式,要权限)。
2.进入git下来的包cd 包下,打开gedit /.git/config,内容大致如下
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://github.com/ethz-asl/orb_slam_2_ros.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
3.进入到自己的gitlab里面,创建一个工程new project->输入工程名字,创建成功之后,把该路径替换掉上面的url = https://github.com/ethz-asl/orb_slam_2_ros.git,内容大致如下
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@gitlab.tfrobot.com:Perception/orbslam2_ros.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
4.最后在自己终端上面把该包git push上去,该分支是master,自己也可以创建自己的分支。