Git子模块的提交与主仓库中的标签匹配 [英] Git submodule's commit matching a tag in the main repo

查看:274
本文介绍了Git子模块的提交与主仓库中的标签匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在检出标签并执行 git status 后,它显示出我:

After I check out a tag and do git status, it shows me:

#       modified:   submodules/bcg729 (new commits)
#       modified:   submodules/belle-sip (new commits)
#       modified:   submodules/externals/ffmpeg (new commits)

git子模块更新检出更早的提交。

但是在 .gitmodules 中,当创建标签时,没有关于子模块中特定提交的信息。 git如何知道它?简单地通过提交日期?

git submodule update checks out earlier commits.
But in .gitmodules there's no info about specific commits in submodules when the tag was created. How does git knows it? Simply by the commit dates?

推荐答案

没有那些提交被注册为索引中的特殊条目

No those commits are registered as a special entry in the index.

尝试 git ls-files --stage ,并在模式160000中查找条目:

Try a git ls-files --stage, and look for entry in mode "160000":

git ls-files --stage | grep 160000

您将看到 grep中每个子模块的SHA1关联 result。

You will see the SHA1 associated for each submodules in the grep result.

.gitmodules 仅用于记录名称和URL子模块,而不是它的SHA1。

The .gitmodules is only there to record the name and url of the submodule, not its SHA1.

这篇关于Git子模块的提交与主仓库中的标签匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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