我对 git并不陌生。我知道分离的 HEAD 是什么,我可以签出一个新的分支来继续前进。但是今天我看到的是一条detached from
消息而不是一条detached at
消息。在尝试中止包含 2 个子模块的 repo 中的合并时,我的一个子模块陷入了这种状态:
so_is_my_nacho_cheese$ git status
HEAD detached from 9733eeb0
nothing to commit, working tree clean
问题一:
从部分让我失望。我见惯了at
。这个提交是指什么?这是 HEAD 在被移动到无分支提交之前的最后一个地方吗?就我而言,该提交位于子模块 reflog 中,但它位于HEAD@{7}
. 那似乎不是 HEAD 的最后一个地方。但由于这是父模块中合并失败的结果,因此可能无法跟踪 HEAD 的移动。这个detached from
提交通常指的是什么?
问题2:
为了增加我的困惑,根据 git log,我的 HEAD指向子模块中的一个分支:
so_is_my_nacho_cheese$ git log --graph --oneline -n 5
* ba737d3b (HEAD, xdhmoore_pascal) Just to record pascal run
* 5b69ce96 Fix fine_tune_checkpoint_loading
* 21dc78b2 Just docker changes applied to base
* 9733eeb0 (xdhmoore_base) Updating center_net_mobilenet_v2_fpn_feature_extractor to support classification finetuning.
* 63ec7359 Adding float feature to dataset_util
为什么git status
告诉我我的 HEAD 是分离的(从 9733eeb0
,虽然不是在什么提交),而git log
说它是指向的ba737d3b
?