Where is the git submodule revision actually stored?
The .gitmodules file just records the path and remote URL to the submodule repository. The commit itself is stored in the tree object. You can query it like this:

git ls-tree &lt;ref&gt; &lt;path&gt;


where &lt;ref&gt; is a reference to some commit (e.g. HEAD, master, a commit SHA sum) and &lt;path&gt; is a path to a submodule.

The output looks something like this:

160000 commit &lt;sha&gt; &lt;path&gt;


where &lt;sha&gt; is the commit in the submodule. The number in front has the following meaning, according to the Git book:


  Notice the 160000 mode for the DbConnector (submodule path of the example used in the book) entry. That is a special mode in Git that basically means you’re recording a commit as a directory entry rather than a subdirectory or a file.


See also this question on StackOverflow.