公司GitLab项目迁移,
改 .git/config 里面的地址就行。多分支的还需要一个一个checkout下来。
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = http://gitlab.xyz.com/app/app.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [branch "xxx"] remote = xxx merge = refs/heads/xxx [branch "yyy"] remote = origin merge = refs/heads/yyy
代码还可以提到到多个仓库:
[remote "web"] url = ssh://server.example.org/home/ams/website.git url = ssh://other.exaple.org/home/foo/website.git
另外可以看到我们push的时候是这样的:
git push origin master orgin:指的就是上面的 remote "origin"master:是指的当前分支 比如要提交xxx分支
git push origin xxx 所以如果在上面配置origin2,定义为另外一个地址,估计也是可以的。
git push origin2 xxx
时间: 2024-10-10 08:00:30