我还是一个 Git 新手。我修改了一些源文件并提交了。然后,我执行了 git push
命令。但是,我得到了以下错误提示。
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.
这个错误似乎是因为在进行push
操作之前我没有执行git pull
。所以,我执行了git pull
。好的,有两个文件已经被其他人修改过了。
接着,我成功地执行了git push
。
问题:在这种情况下,我看到我的原始提交信息后还有一个类似以下内容的日志:
commit 59e04ce13b8afa...
Merge: 64240ba 76008a5
Author: Jone Doe <jone@doe.com>
Date: Fri Mar 15 11:08:55 2013 -0700
Merge branch 'master' of /foo/bar/
这是我最初的提交消息。
commit 64240bafb07705c...
Author: Jone Doe <jone@doe.com>
Date: Fri Mar 15 11:06:18 2013 -0700
Fixed bugs and updated!
我想了解为什么要添加“合并位置的主分支”。