背景:
我有两个仓库:
1.https://gitee.com/lanjerry/lanjerry-framework
2.https://github.com/lanjerry/lanjerry-framework
更新代码的时候,想同时推送,不想一个一个来推送,太麻烦了
步骤:
1.先用remote命令查看现有的仓库
git remote -v

2.先用remote命令添加另一个的仓库
git remote set-url --add origin https://github.com/lanjerry/lanjerry-framework.git
3.再次查看现有仓库,github仓库已经添加进去了

测试:
更改一个readme.md文件测试提交,有可能报错

解决:先用git push -f
强制提交,然后再git push
,如果不管用输入:git pull --rebase origin master
之后再进行git push
即可

网友评论