之前有個項目一直在私人倉庫,領(lǐng)導(dǎo)讓我遷移到部門的倉庫燃领,就搞了一下衷掷。具體步驟如下:
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