Error: Failed to push some refs to ‘… , “I run into this problem at first time is also very trouble, also see a lot of articles, is relatively complicated, and I as a small white also dare not rashly to operate, afraid of accidentally a command let me also don’t know how to solve the” ruin “, actually itself this was not a big problem, but do not pay attention to words, will drop pit.

Git push error this problem usually occurs when you need to push your own local code to a remote repository

The simplest solution:

  1. Git log: View your commit history
  2. Git reset –soft + your commit ID will reset to the last version.
  3. Re-execute Git pull
  4. git push