git push ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/Operater9/guest' hint: Updates were rejected because the tip of your current bra

Push native code to github error

git push error

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/Operater9/guest'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

After check the information found no local update to the latest version of the project (there is not the git README.md file download)

Local direct push to be wrong.

 

Execute the following command pull, or not

$ git pull origin master
From https://github.com/Operater9/guest
 * branch            master     -> FETCH_HEAD
fatal: refusing to merge unrelated histories

 

The following code is executed

Reference https://stackoverflow.com/questions/24114676/git-error-failed-to-push-some-refs-to

git pull --rebase origin master

This time has been found to download the latest files on github down: that is README.md file.

 

Then push the implementation of

git push -u origin master

Successful push to a remote repository native code

Reference https://blog.csdn.net/u013120247/article/details/53263169

 

Guess you like

Origin www.cnblogs.com/z-x-y/p/11291148.html