如何在GitHub上合并远程更改?
我遇到下面的错误,试图首先尝试Github:
[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.
我该如何解决这个问题并合并远程更改?
有关详细信息,请参阅'git push --help'的'非快进'部分。
你可以执行“git pull”,解决潜在的冲突,以及“git push”结果。 “git pull”将在提交A和B之间创建合并提交C.
或者,您可以使用“git pull --rebase”重新设置A之间X和B之间的更改,并将结果推回。 rebase将创建一个新的提交D,它在A之上构建X和B之间的变化。
您也可以通过在分支名称前添加+符号来强制推送。
git push origin +some_branch
你可能在github上有变化,你永远不会合并。 尝试git pull
来获取并合并更改,然后您应该能够推送。 对不起,如果我误解了你的问题。
上一篇: How to merge remote changes at GitHub?
下一篇: could not resolve host github.com error while cloning remote repository in git