我在本地计算机和远程服务器上设置了三个git存储库。我修改我的本地机器上的源代码,推到裸回购在服务器上,登录到服务器,从裸回购拉我的网站:Git无法从重置中提取更改
Local Machine SERVER
+++++++++++++++++ +++++++++++++++++++++++++++++++++
+ Source Code + + Website +
+ repo 1 ---------------->bare repo----------->repo 3 +
+ + [push] + [pull] +
+++++++++++++++++ +++++++++++++++++++++++++++++++++
我重置一些提交我的本地机:
HEAD
1 2 3 4
o-----o-----o-----o
git reset --hard 1
HEAD
1 2 3 4
o-----o-----o-----o
当我按下复位裸回购
git push -f
的问题是,我似乎并没有能够从裸回购到我的网站拉他们:
git pull origin master
From bare-repo
* branch master -> FETCH_HEAD
Already up-to-date.
编辑:git log --graph --oneline --decorate
本地计算机的输出:
* 0f8c9c7 (HEAD -> master, origin/master, origin/HEAD) commit 1
* 3e65e8f commit 0
* 821e81f commit -1
* 78c9427 commit -2
* 57ab3d3 commit -3
服务器:
* 5075401 (HEAD, master) commit 4
* 39402d0 commit 3
* 4ebbf54 commit 2
* 0f8c9c7 commit 1
* 3e65e8f commit 0
* 821e81f (origin/master, origin/HEAD) commit -1
* 78c9427 commit -2
'git log --graph --oneline --decorate'看起来像什么?感觉鼓励删除您不想分享的任何细节。 – Makoto
伙计们,我认为'git reset'只影响HEAD,HEAD只是一个没有SHA哈希的符号引用,所以你不能推或拉它,我错了吗? @Makoto –
'git reset'将HEAD移动到工作树中的特定点。它代表了你的树的尖端。推拉并没有真正的背景。在任何一种情况下......我真的*喜欢看到我给你的那个命令的输出...... – Makoto