推從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