This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center。
9年前关闭。
我对主哈希6877146进行了提交,该哈希更新了一个子模块。
该提交位于master分支上,我目前已 check out 该分支:
但是,在子模块上执行git log不会显示提交:
如果我明确 checkout 此提交,则它在日志中:
我 check out master后,为什么该提交未在日志中显示?它已经 merge 到母版中:
9年前关闭。
我对主哈希6877146进行了提交,该哈希更新了一个子模块。
$ git show 6877146
commit 6877146f1781bfbd4ec3ae2a27121a606f5f688e
Author: [snip]
Date: Wed Feb 22 16:10:20 2012 +0000
updating potatobase
diff --git a/potatobase b/potatobase
index 5877e2c..b77ba62 160000
--- a/potatobase
+++ b/potatobase
@@ -1 +1 @@
-Subproject commit 5877e2c2d82645fa44f121884291ee48cf24584d
+Subproject commit b77ba624d6a1c5e62d434ad2d06383604aeab431
该提交位于master分支上,我目前已 check out 该分支:
$ git branch -a --contains 6877146
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/ticket-1479-refactor-blade-json-functions
但是,在子模块上执行git log不会显示提交:
$ git log potatobase | grep 6877146
$
如果我明确 checkout 此提交,则它在日志中:
$ git checkout 6877146
$ git log potatobase | grep 6877146
commit 6877146f1781bfbd4ec3ae2a27121a606f5f688e
我 check out master后,为什么该提交未在日志中显示?它已经 merge 到母版中:
$ git checkout master
$ git merge 6877146
Already up-to-date.
$
最佳答案
当您初始化/更新子模块时,提交更新子模块的提交只会更改修订版git将会 checkout 。该提交的提交ID与子模块本身的提交ID毫无关系。