天天看點

将Git 項目遷移到另一個倉庫

将Git 項目遷移到另一個倉庫

1、建立舊倉庫的裸克隆

git clone --bare https://github.com/exampleuser/old-repository.git      

執行上述指令後,會在本地生成一個名叫

old-repository.git

的檔案夾。

2、遷移到新倉庫

cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git      

這樣的話,項目就已經遷移到新倉庫了。

注意,我們不需要手動建立一個空的新倉庫,當我們執行上述指令之後,新倉庫就已經自動建立好了。

本文來自部落格園,作者:農碼一生,轉載請注明原文連結:https://www.cnblogs.com/wml-it/p/15591642.html

技術的發展日新月異,随着時間推移,無法保證本部落格所有内容的正确性。如有誤導,請大家見諒,歡迎評論區指正! 個人開源代碼連結: GitHub:

https://github.com/ITMingliang

Gitee:

https://gitee.com/mingliang_it

GitLab:

https://gitlab.com/ITMingliang

進開發學習交流群:
将Git 項目遷移到另一個倉庫
git