Git with git push appears failed to push some refs to git ... The workaround

Source: Internet
Author: User

Error message:

[Email protected]/k/cocos2d/yc (master)

$ Git push-u Origin Master

to [email protected]:yangchao0718/cocos2d.git

! [Rejected] master, master (Non-fast-forward)

Error:failed to push some refs to ' [email protected]: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 ' "Git push--help ' for details.

The main reason for this error is that the readme.md file in GitHub is not in the local code directory

You can merge the code with the following command: Pull=fetch+merge

Git pull--rebase Origin master

After executing the above code, you can see that the local code base has more readme.md files

Now execute the statement GIT push-u Origin master to complete the code upload to GitHub

It's OK.

Git with git push appears failed to push some refs to git ... The workaround

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.