[Email protected]/k/cocos2d/YC (Master) $ git push-u Origin masterto [email protected]:yangchao0718/Cocos2d.git! [Rejected] master, master (non-fast-forward) error:failed to push some refs to'[Email Protected]:yangchao0718/cocos2d.gitHint:updates were rejected because the tip of your current branch is behinhint:its remote counterpart. Integrate the remote changes (e.g.hint:'git pull ...') before pushing Again.hint:See the'Note about Fast-forwards' inch 'git push--help' forDetails.
1. You may get an error when you push the source code to GitHub using Git, with the following information
2.
At this point many people will try the following command to upload the current branch code to the Master branch.
$ Git push-u Origin Master
But it still didn't work out.
3. The main reason for the error is that the readme.md file in GitHub is not in the local code directory
4. You can use the following command to merge code "NOTE: Pull=fetch+merge]
Git pull--rebase Origin master
5. After executing the above code, you can see that there are many readme.md files in the local code base
6. Execute the statement now GIT push-u Origin master to complete the code upload to GitHub
How to troubleshoot failed to push some refs to git