我对以下事件顺序有几个问题。关于分歧的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