推从git help push
:
For a failed update, more details are given:
rejected
Git did not try to send the ref at all, typically because it is not a fast-forward and you did not force the update.
remote rejected
The remote end refused the update. Usually caused by a hook on the remote side, or ...
- 你必须遵循上述规则才能推动(即你不能打破Git的历史,松散的提交...)
- 你应该(几乎)不会强迫推。
git pull
命令是git fetch && git merge
(或git rebase
,如果使用--rebase
选项)的快捷方式。所以你可以先获取然后手动合并远程更改。
git status
告诉你,如果你是上游的背后,如果你分支可以很容易地更新:
Your branch is behind 'origin/master' by 4 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
Git-prompt是非常方便快速的了解是否有远程的变化来检索和合并。请参阅“u-4
”在git fetch
后的提示和4个进入提交内容git log [email protected]{u}
报道名单:
(master $ u= origin/master)]$ git fetch
(master $ u-4 origin/master)]$ git log [email protected]{u} --oneline
7edead8 NXP-15160 fixing test class path for redis test-jar
d507b6f NXP-15160 renamed cache component
aaf64ab NXP-15161 re-worked redis feature activation
23b1d2c NXP-15254: use concurrent hash maps to avoid locks on service access
嗯,你们不应该覆盖其他代码,除非你是力推分支机构。它总是会产生冲突,您必须解决合并问题。我建议你们使用功能分支,这样你就不会像彼此的工作那么多。即http://nvie.com/posts/a-successful-git-branching-model/ – 2014-09-19 00:07:05
@ LukeHutton - 谢谢,我同意这很奇怪。我不能排除推动力量。也许那是无意中发生的。 – 2014-09-19 00:09:49