is it possible to find out, which commit of submodule is a branch I am not 
currently on pointing to?



For example, I have branch ‘master’, and branch ‘dev’. Both of them have 
submodule ‘subA’. ‘master’ branch is pointing to commit “123” of this 
submodule, and branch ‘dev’ to commit “456”.

If I am on branch ‘master’, I can find out this information by calling “git 
submodule”, which will result in:

*123** path/to/submodule/subA*


How can I found the commit for branch ‘dev’, without checking it out?


I have found out that calling this “git cat-file -t 
dev:path/to/submodule/subA” will result into:

*error: unable to find 456*

*fatal: git cat-file dev:path/to/submodule/subA: bad file*

* *

I have the information i needed (456), but I do not want to rely on an 
error message. Is the any other solution? 

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to