I have a git submodule in my main git repo. As I understand it, the main repo stores a SHA value (somewhere...), pointing to the specific commit of the submodule that it is \"li
To change the commit that a submodule points to, you need to checkout that version in the submodule, then go back to the containing repo, add and commit that change.
Or, if you want the submodule to be on the version the top repo points to, do git submodule update --recursive. Add --init if you've just cloned.
Also, git submodule without a submodule command will show you the commit you are pointing to. There will be a - or a + in front of the commit if it's not in sync.
If you look at a tree with a submodule in it, you can see that the submodule is marked as a commit as opposed to the rest that are blobs or trees.
to see what a particular commit points wrt to submodules you can:
git ls-tree Submodule/path
you can then see the commit or anything else if you like by passing that into log, etc (the git-dir option at the git command level allows you to skip having to cd down to the submodule):
git --git-dir=Submodule/path log -1 $()