这个问题首次上传远程仓库:error: failed to push some refs to 'https://gitee.com/zhang-bingqian/crm.git'
怎样解决?
文章目录
- 问题
- 解决方案:
问题
D:\ideaProject\crm\crm>git push -u origin master To https://gitee.com/zhang-bingqian/crm.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://gitee.com/zhang-bingqian/crm.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
解决方案:
因为问题可能会出现oschina中的README.md文件不在本地代码目录中,所以我们需要在本地拥有,否则会发生冲突。你应该已经明白了可以解决的方案。直接添加参数-f也可以,但是太粗暴了。
,后果可能是同步的,一般不推荐。最简单的方法如下
:
1. git pull --rebase origin master
看效果:
git push -u origin master
看看是否成功?