网上找了很多,发现这一篇挺好,但是有些地方不够完善,所以复制过来修改下
需要四行命令:
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,打开关闭里面的分支保护,重试即可,参考链接