包括分支以及提交記錄數據的遷移。
最近公司的代碼倉庫由自建的git倉庫遷移到了云效,經過多次測試,終于找到了最好的解決方法。
1,先將所有人的代碼都提交并push到遠程倉庫。
2,找一個文件夾中執行git 命令克隆一份裸版本庫
git clone --bare git://39.xx.xx.xx/project_name.git
3、進入到project_name.git目錄中,再執行git push --mirror命令,將代碼推送到新倉庫
cd project_name.git
git push --mirror git@code.aliyuan.com/path/new_project_name.git
待命令執行完畢后,就可以在新倉庫中看到所有的項目文件,接下來就可以使用git clone命令從新倉庫下載代碼,或者修改原有項目的remote地址,整個遷移過程圓滿完成。
轉自:https://blog.csdn.net/lee4755026/article/details/104501908
http://www.lxweimin.com/p/59516a17fcf3