git 仓库搬迁 包括所有分支,记录;
1:登录新的服务器
2:执行下面代码
git clone --mirror <旧的仓库地址>
eg : git remote set-url origin ssh://git@xxx.xxx.xxx.xxx/home/mgitproject/xxx/xxx
cd <刚clone的文件夹>
git remote set-url origin <新的仓库地址>
git push -f origin
如果 出现failed to push some refs to git
运行下面命令:
git pull --rebase origin master
来源:CSDN
作者:Dev05
链接:https://blog.csdn.net/lqb3732842/article/details/103611849