I have a repo which a submodule in it.
I can get the current hash of the submodule from the working directory easily:
cd submodule
git rev-list HEAD | head -n 1
However i am also interested in the hash at previous versions of the main repo. I can get it if i actually check out that version:
git checkout some_tag
cd submodule
git rev-list HEAD | head -n 1
However, i cannot use git checkout. Is there a way to obtain that hash without checking out the old tag?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…