当我第一次尝试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.
如何修复此问题并合并远程更改?
发布于 2012-03-09 13:40:27
您还可以通过在分支名称前添加+符号来强制推送。
git push origin +some_branch
发布于 2009-11-11 13:06:09
您可能在github上有从未合并过的更改。尝试使用git pull
来获取并合并更改,然后就可以进行推送了。如果我误解了你的问题,很抱歉。
发布于 2012-05-03 06:42:23
如果您"git pull“显示”已更新“,但仍然收到此错误,则可能是因为您的其他分支中有一个不是最新的。尝试切换到另一个分支并确保其中一个分支也是最新的,然后再尝试"git推送“:
切换到分支"foo“并更新它:
$ git checkout foo
$ git pull
您可以通过发出以下命令来查看所获得的分支:
$ git branch
https://stackoverflow.com/questions/1713137
复制相似问题