Git日志不显示子模块更改

Wil*_*hes 6 git git-submodules

我有一个提交master,hash 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
Run Code Online (Sandbox Code Playgroud)

这个提交在master分支上,我目前已检查过:

$ git branch -a --contains 6877146
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/ticket-1479-refactor-blade-json-functions
Run Code Online (Sandbox Code Playgroud)

但是,在子模块上执行git log并不会显示提交:

$ git log potatobase | grep 6877146
$
Run Code Online (Sandbox Code Playgroud)

如果我明确地检查了这个提交,它就在日志中:

$ git checkout 6877146
$ git log potatobase | grep 6877146
commit 6877146f1781bfbd4ec3ae2a27121a606f5f688e
Run Code Online (Sandbox Code Playgroud)

当我检查出master时,为什么这个提交没有显示在日志中?它已经合并为主人:

$ git checkout master
$ git merge 6877146
Already up-to-date.
$
Run Code Online (Sandbox Code Playgroud)

Thi*_*ter 2

更新子模块的提交只会更改 git 在初始化/更新子模块时签出的修订版本。该提交的提交 ID 与子模块本身的提交 ID 没有任何关系。