admin管理员组文章数量:1295856
Where does git store the hash of a submodule that would be checked out if I did this?
git submodule update --init --recursive
I want to write a program that prints the expected hash and the current hash (as well as the submodule paths and the corresponding branch names) for all submodules for which the two hashes don't match.
Where does git store the hash of a submodule that would be checked out if I did this?
git submodule update --init --recursive
I want to write a program that prints the expected hash and the current hash (as well as the submodule paths and the corresponding branch names) for all submodules for which the two hashes don't match.
Share edited Feb 17 at 23:19 SU3 asked Feb 12 at 1:19 SU3SU3 5,4093 gold badges43 silver badges71 bronze badges 3 |1 Answer
Reset to default 1git rev-parse revision:path/to/submodule
outputs the hash. revision
can be anything pointing to a commit for which you want to learn the hash of the submodule: it can be HEAD
, branch like master
, a tag, a commit hash.
path/to/submodule
is the path from repository root.
本文标签: Where to find the expected git submodule hashStack Overflow
版权声明:本文标题:Where to find the expected git submodule hash - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741626489a2389112.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
git rev-parse HEAD:path/to/submodule
Found in stackoverflow/search?q=%5Bgit-submodules%5D+hash – phd Commented Feb 12 at 6:48git rev-parse HEAD:path/to/submodule
for each one takes a while. I want to write a single program that would find these hashes on its own. Does anyone know where these are saved? I've tried reading.git/modules/Submodule/refs/remotes/origin/Branch
, but that doesn't always give the same hash, or doesn't even exist for some submodules. – SU3 Commented Feb 12 at 18:25git rev-parse
multiple revisions as arguments and it'll parse them all in one process. That works for me. – SU3 Commented Feb 13 at 5:30