我还是git新手。我修改了一些源文件并提交。然后,我做了git push
。但是,我得到了这个错误。git:为什么“合并分支”“......”的主人?当拉和推
To /foo/bar/ ! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '/foo/bar/' To prevent you from
losing history, non-fast-forward updates were rejected Merge the
remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.
这似乎拒绝我没git pull
push
之前。所以,我做了git pull
。好的,其他人有两个修改过的文件。
然后,我能够成功地git push
。
问题:在这种情况下,我看到多了一个日志像我原来的提交信息如下:
commit 59e04ce13b8afa...
Merge: 64240ba 76008a5
Author: Jone Doe <[email protected]>
Date: Fri Mar 15 11:08:55 2013 -0700
Merge branch 'master' of /foo/bar/
这是我原来的提交信息。
commit 64240bafb07705c...
Author: Jone Doe <[email protected]>
Date: Fri Mar 15 11:06:18 2013 -0700
Fixed bugs and updated!
我想了解为什么要添加“合并分支主位置”。
[Git pull可能重复导致无关的“合并分支”消息在提交日志](http://stackoverflow.com/questions/8509396/git-pull-results-in-extraneous-merge-branch-messages-in-commit-log),其中有更多更详细的答案 – 2016-07-04 22:58:07