Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
子模块的提交ID是否保存在git标记中?_Git_Github_Git Submodules_Git Tag - Fatal编程技术网

子模块的提交ID是否保存在git标记中?

子模块的提交ID是否保存在git标记中?,git,github,git-submodules,git-tag,Git,Github,Git Submodules,Git Tag,这背后的动力是管理GitHub的源代码和wiki存储库,并能够git标记发布整个项目的状态。如果有更简单的方法,我会洗耳恭听的:) 我需要能够在标记中包含子模块状态的某种标识符(例如,返回为git submodule status)。我真的不需要将它打包(如中所示)-我只需要能够包含此标识符,但任何其他可用的功能都非常棒 顺便说一句,我很惊讶.gitmodules中没有跟踪到这一点。我知道它在.git的某个地方,但似乎没有跟踪其中的任何信息(不跟踪它是有意义的)。与子模块关联的提交id作为包含

这背后的动力是管理GitHub的源代码和wiki存储库,并能够
git标记
发布整个项目的状态。如果有更简单的方法,我会洗耳恭听的:)


我需要能够在标记中包含子模块状态的某种标识符(例如,返回为
git submodule status
)。我真的不需要将它打包(如中所示)-我只需要能够包含此标识符,但任何其他可用的功能都非常棒


顺便说一句,我很惊讶
.gitmodules
中没有跟踪到这一点。我知道它在
.git
的某个地方,但似乎没有跟踪其中的任何信息(不跟踪它是有意义的)。

与子模块关联的提交id作为包含子模块的目录的
树中的
commit
对象存储。例如,我已经在本地签出了,它在
packstack/puppet/modules
中有许多子模块;我们可以看到这样的提交:

$ git ls-tree HEAD | awk '/packstack/ {print $3}'
e7f8ff02ee9ceb26df165439fdffdad13e7ffe63
$ git ls-tree e7f8ff02ee9ceb26df165439fdffdad13e7ffe63 | awk '/puppet/ {print $3}'
0f710acfee985c3f8c3e559425a76194a4a809ea
$ git ls-tree 0f710acfee985c3f8c3e559425a76194a4a809ea | awk '/modules/ {print $3}'
1ccbe1d23c3ae2f2fe6aab987dd8d84d634012ef
$ git ls-tree 1ccbe1d23c3ae2f2fe6aab987dd8d84d634012ef
160000 commit 6d2dc044e12c4c687647cff8bc60c981d9ed5312  heat
160000 commit 17ba6a73cec7f386922e6a914a120a829e225efc  horizon
160000 commit fe9b0d5229ea37179a08c4b49239da9bc950acd1  inifile
160000 commit bb67ef3e0a7c605cee97f9a8ccd13000290f9b39  keystone
.
.
.
当然,您可以从
HEAD
之外的其他地方开始查看存储库早期版本的提交ID