我對以下事件順序有幾個問題。關於分歧的GIT分支
有2位開發人員正在研究此代碼。首先,是什麼原因導致分支在第一個位置發生分歧?
11:05:08 ~/myApp $ git status
# On branch Dev
# Your branch and 'origin/Dev' have diverged,
# and have 1 and 3 different commit(s) each, respectively.
#
nothing to commit (working directory clean)
11:10:39 ~/myApp $ git push origin Dev:Dev
To ssh://[email protected]/myApp-web.git
! [rejected] Dev -> Dev (non-fast-forward)
error: failed to push some refs to 'ssh://[email protected]/myApp-web.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
由於Git的建議,我試圖從remote/Dev
做拉當地Dev
,只看到:但是
11:10:51 ~/myApp $ git pull origin Dev:Dev
From ssh://mygitserver/myApp-web
! [rejected] Dev -> Dev (non-fast-forward)
的Git拉合作。 爲什麼git pull工作和git拉起源Dev:Dev失敗?
11:13:05 ~/myApp $ git pull
Merge made by recursive.
WebContent/BL/a.jsp | 14 +++++-------
WebContent/RJ/b.jsp | 3 +-
.../RJ/c.jsp | 22 ++++++++++----------
WebContent/RJ/d.jsp | 14 ++++++------
WebContent/TM/e.jsp | 12 ++++------
5 files changed, 31 insertions(+), 34 deletions(-)
隨後git status
和git push origin Dev:Dev
工作沒有冒險。
對於OP:遠程的變化發生*和*本地資源庫的真正含義,別人做了更改,並將其推到遠程,所以認爲它是發散的發展由你做和至少一個其他開發商。 – Cascabel