1

After I check out a tag and do git status, it shows me:

#       modified:   submodules/bcg729 (new commits)
#       modified:   submodules/belle-sip (new commits)
#       modified:   submodules/externals/ffmpeg (new commits)

git submodule update checks out earlier commits.
But in .gitmodules there's no info about specific commits in submodules when the tag was created. How does git knows it? Simply by the commit dates?

1 Answer 1

1

No those commits are registered as a special entry in the index.

Try a git ls-files --stage, and look for entry in mode "160000":

git ls-files --stage | grep 160000

You will see the SHA1 associated for each submodules in the grep result.

The .gitmodules is only there to record the name and url of the submodule, not its SHA1.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.