Error
$ 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 ' about Fast-forwards ' in ' git push–help ' for details. problem
How to resolve failed to push some refs to git
Tools/raw Materials
Git
Method/Step 1
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 still failed to solve the problem 2
The main reason for the error is that the readme.md file in GitHub is not in the local code directory
You can merge code with the following command "NOTE: Pull=fetch+merge]
Git pull–rebase Origin Master
After executing the above code, you can see that there are more readme.md files in the local code base 3
Now execute the statement GIT push-u Origin master to complete the code upload GitHub
Reference:
Baidu Encyclopedia
CSDN code to create a project