我已经从master
,offsore-dev
创建了一个分支。在一台机器上1 git日志说:
$ git log --branches
commit ac7bbc5e9b07d381309edc885d7285820a05b199
Author: U-PAPU-SERVER\Administrator <Administrator@PAPU-SERVER.(none)>
Date: Fri Mar 7 10:12:12 2014 +0000
Second Commit in offsore-dev branch
commit 7c909e2d30545fab7a27e29163ae98ac6b1f6947
Author: U-PAPU-SERVER\Administrator <Administrator@PAPU-SERVER.(none)>
Date: Fri Mar 7 09:56:19 2014 +0000
Offsore-dev-commit1
commit 7cc48e58d7d16dc6e761628ceabf8fdc9c4fc378
Author: U-PAPU-SERVER\Administrator <Administrator@PAPU-SERVER.(none)>
Date: Fri Mar 7 09:29:39 2014 +0000
my second commit
commit f2e1e6e3115c6d0ae0b057836e1c91779328fabe
Author: Papu <papubhat@gmail.com>
Date: Fri Mar 7 17:18:55 2014 +0530
My first Commit
Administrator@PAPU-SERVER /cygdrive/E/testgit/testgit
在另一台机器2
commit 7c909e2d30545fab7a27e29163ae98ac6b1f6947
Author: U-PAPU-SERVER\Administrator <Administrator@PAPU-SERVER.(none)>
Date: Fri Mar 7 09:56:19 2014 +0000
Offsore-dev-commit1
commit 7cc48e58d7d16dc6e761628ceabf8fdc9c4fc378
Author: U-PAPU-SERVER\Administrator <Administrator@PAPU-SERVER.(none)>
Date: Fri Mar 7 09:29:39 2014 +0000
my second commit
commit f2e1e6e3115c6d0ae0b057836e1c91779328fabe
Author: Papu <papubhat@gmail.com>
Date: Fri Mar 7 17:18:55 2014 +0530
My first Commit
我已从机器1反复推动并从机器2拉出所有。为什么日志仍然有差异?在第二台机器上为什么我错过了“offsore-dev分支中的第二次提交”提交?
$ git remote -v
origin ssh://192.168.1.19:/opt/data/git/testgit.git (fetch)
origin ssh://192.168.1.19:/opt/data/git/testgit.git (push
$ git log offsore-dev..
commit 8e9496d2f0c8a933a98b78e6050301d1fb199006
Author: U-PAPU-SERVER\Administrator <Administrator@PAPU-SERVER.(none)>
Date: Sat Mar 8 06:46:15 2014 +0000
Third commit
commit ac7bbc5e9b07d381309edc885d7285820a05b199
Author: U-PAPU-SERVER\Administrator <Administrator@PAPU-SERVER.(none)>
Date: Fri Mar 7 10:12:12 2014 +0000
Second Commit in offsore-dev branch
$ git push -u origin offsore-dev
Branch offsore-dev set up to track remote branch offsore-dev from origin.
Everything up-to-date
$ git log offsore-dev..
commit 8e9496d2f0c8a933a98b78e6050301d1fb199006
Author: U-PAPU-SERVER\Administrator <Administrator@PAPU-SERVER.(none)>
Date: Sat Mar 8 06:46:15 2014 +0000
Third commit
commit ac7bbc5e9b07d381309edc885d7285820a05b199
Author: U-PAPU-SERVER\Administrator <Administrator@PAPU-SERVER.(none)>
Date: Fri Mar 7 10:12:12 2014 +0000
enter code here
Second Commit in offsore-dev branch
我认为它永远不会从这台机器上推出来。不确定原因。
答案 0 :(得分:-1)
如果遥控器没有名为offshore-dev
的分支,则会发生这种情况。要覆盖此行为,您可以在命令
git push origin offshore-dev:<remote name>
如果您要更新master
,请运行以下命令:
git push origin offshore-dev:master
此后运行
git pull
或
git fetch origin
git rebase origin/master
在机器2上你应该看到变化。