How to merge remote changes at GitHub?

I'm getting following error, whn trying first Github push:

[rejected] master -> master (non-fast forward)
error: failed to push some refs to 'git@github.com:me/me.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'non-fast forward'
section of 'git push --help' for details.

how can I fix this and merge remote changes?


See the 'non-fast forward' section of 'git push --help' for details.

You can perform "git pull", resolve potential conflicts, and "git push" the result. A "git pull" will create a merge commit C between commits A and B.

Alternatively, you can rebase your change between X and B on top of A, with "git pull --rebase", and push the result back. The rebase will create a new commit D that builds the change between X and B on top of A.


您也可以通过在分支名称前添加+符号来强制推送。

git push origin +some_branch

You probably have changes on github that you never merged. Try git pull to fetch and merge the changes, then you should be able to push. Sorry if I misunderstood your question.

链接地址: http://www.djcxy.com/p/4630.html

上一篇: 如何更改IDEA Intellij中的GitHub存储库?

下一篇: 如何在GitHub上合并远程更改?