How to solve the problem that occurs during git ==== push. Error: failed to push some refs

Source: Internet
Author: User

When we use git to push the file to the repository, the following problem occurs:

! [Rejected] Master-> master (fetch first)
Error: failed to push some refs to '[email protected]: yaogengzhu/ajax. 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 be 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.

 

 

Solution:

1. Force upload the GIT push-f // git repository address master (but after testing, this method seems to overwrite the repository file! Exercise caution !)

2. Method 2: a) run the following command to merge the code: git pull -- rebase // repository address master

B) then use git to push // The repository address master (the method is to successfully push the file! The repository files are not affected! Recommended)

 

 

Currently, I have mastered these two methods ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~

 

 

How to solve the problem that occurs during git ==== push. Error: failed to push some refs

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.