Git 报错:Updates were rejected because the tip of your current branch is behind

  Just beginning to learn git command, I found that many errors occur, so we summarize the error under arise, in order to deepen understanding and grasp it!

 

Environment: In the local library operations and commit a series of add After the operation, trying to push the local repository to the remote end, but the following error occurs:

错误情况:Updates were rejected because the tip of your current branch is behind

 

Error reason : I created at the far end github repository page, click Create README.md button to create the documentation, but did not pull to the local, thus creating a version conflict.

Solution :

1, the use of push force:

# This method will make the remote modification is lost, it is generally undesirable, especially when many people work together to develop the 
$ git the Push -u -f Origin Master

2, before the first push remote repo modified pull down

# First pull down, push the distal end times for 
$ Git pull Origin Master 
$ Git Push -u Master Origin

 

Guess you like

Origin www.cnblogs.com/zpcoding/p/11519475.html
Recommended