Git仓库迁移所有的分支和标签,也包括日志。

网上找了很多,发现这一篇挺好,但是有些地方不够完善,所以复制过来修改下

需要四行命令:

git clone --mirror <URL to my OLD repo location>
cd <my OLD repo location path>
git remote set-url origin http://git.xxxxxx.com/xxx/nginx-lb
git push -u origin --all
git push -u origin --tags

如果 git push -f origin 报错 出现failed to push some refs to git

可以通过以下方式解决:

在代码仓库控制面板,取消master分支保护功能,在项目里有一个settings,在里面有个Protected Branches,打开关闭里面的分支保护,重试即可,参考链接

参考链接:https://blog.csdn.net/diyiday/article/details/85247749

发布了40 篇原创文章 · 获赞 59 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/weixin_44208042/article/details/103636666
今日推荐