Basically it is the Git default that a submodule is pegged to a specific hash (i.e., the checkout commit of the submodule) with a commit in the super project (however, the submodule is not automatically updated when you change your parent repository by default - to do this manually TortoiseGit offers the "Submodule update" feature or you can configure submodule.recurse
).
If you .gitmodules
file only has a url
and path
value set for a specific submodule, then the checked out hash of the submodule will be included in the comment if the "parent" repository.
You can verify this in the log dialog when you diff a commit which contains a submodule, then you can see the hash of the submodule there. Unless this commit is checkedd out in the submodule, it will be reported as modified in the parent repository.
In order to update the submodules to that specific version (e.g., after a pull or switch/checkout), you need to run "Submodule update" (possibly with the force option in order to force the submodule to that revision - this might cause data loss in the submodule locally).
Further reading: