Git日志不显示子模块更改 [英] Git log doesn't show submodule changes

查看:108
本文介绍了Git日志不显示子模块更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  $ git show 6877146 
我有一个对master的提交,hash 6877146,它更新了一个子模块。提交6877146f1781bfbd4ec3ae2a27121a606f5f688e
作者:[snip]
日期:Wed Feb 22 16:10:20 2012 +0000

更新potatobase

diff --git a / potatobase b / potatobase
index 5877e2c..b77ba62 160000
--- a / potatobase
+++ b / potatobase
@@ -1 +1 @@
-Subproject commit 5877e2c2d82645fa44f121884291ee48cf24584d
+子项目提交b77ba624d6a1c5e62d434ad2d06383604aeab431

该提交位于主分支上,我目前已经签出:

  $ git branch -a --contains 6877146 
* master
remotes / origin / HEAD - >原产地/主产地
遥控器/原产地/主产地
遥控器/产地/售票处1479-重构刀片式json功能

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

  $ git登录potatobase | grep 6877146 
$

如果我明确检查此提交,它在日志中:

  $ git checkout 6877146 
$ git log potatobase | grep 6877146
commit 6877146f1781bfbd4ec3ae2a27121a606f5f688e

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

  $ git checkout master 
$ git merge 6877146
已经达到-日期。
$


解决方案

更新子模块当您初始化/更新子模块时,修改git会检查。该提交的提交ID与提交子模块本身无关。


I have a commit on master, hash 6877146, which updates a submodule.

$ 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

This commit is on the master branch, which I currently have checked out:

$ git branch -a --contains 6877146
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/ticket-1479-refactor-blade-json-functions

However, doing git log on the submodule does not show the commit:

$ git log potatobase | grep 6877146
$

If I explicitly check out this commit, it's in the log:

$ git checkout 6877146
$ git log potatobase | grep 6877146
commit 6877146f1781bfbd4ec3ae2a27121a606f5f688e

Why is this commit not shown in the log when I've checked out master? It's already merged into master:

$ git checkout master
$ git merge 6877146
Already up-to-date.
$

解决方案

A commit updating a submodule just changes the revision git will checkout when you init/update the submodule. The commit id of that commit is in no way related to commit ids of the submodules itself.

这篇关于Git日志不显示子模块更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆