如何解决failed to push some refs to git
Administrator@PC-20150110FGWU /K/cocos2d/yc (master)
$ git push -u origin master
To git@github.com:yangchao0718/cocos2d.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:yangchao0718/cocos2d.git
hint: Updates were rejected because the tip of your current branch is behin
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
1、出现错误的主要原因是github中的README.md文件不在本地代码目录中
2、可以通过如下命令进行代码合并 git pull --rebase origin master
本文解析了在尝试将代码推送到GitHub时遇到的'failed to push some refs'错误原因,通常由于本地分支落后于远程分支。提供了通过执行'git pull --rebase origin master'来合并远程更改并解决冲突的方法。
749

被折叠的 条评论
为什么被折叠?



