之前有个项目一直在私人仓库,领导让我迁移到部门的仓库,就搞了一下。具体步骤如下:
git remote add $源名称$ 仓库地址
例如:
git remote add abc git@gitlab.xxx.org:xxx/abc.git
然后需要将新建的源代码pull到本地,注意需要添加allow-unrelated-histories
git fetch abc
git merge abc/master --allow-unrelated-histories
最后
git push abc