Where does Git store the SHA1 of the commit for a submodule?

前端 未结 1 1945
渐次进展
渐次进展 2020-12-04 06:57

I know that when you add a submodule to a git repository it tracks a particular commit of that submodule referenced by its sha1.

I\'m trying to find where this sha1

相关标签:
1条回答
  • 2020-12-04 07:26

    It is stored in Git's object database directly. The tree object for the directory where the submodule lives will have an entry for the submodule's commit (this is the so-called "gitlink").

    Try doing git ls-tree master <path-to-directory-containing-submodule> (or just git ls-tree master if the submodule lives in the top-level directory).

    0 讨论(0)
提交回复
热议问题