For some reason the git command git clone --recursive git@github.com:foo/bar.git
is not pulling the latest from the
submodules.
For the submodule "sub", it is going back to an older commit:
$ cd other/sub/
$ git log | head -1
commit 57d0df7269949ef6d5347c5a4556fde7eafef16d
$ grep -r 57d0df7269949ef6d5347c5a4556fde7eafef16d .git/*
.git/modules/other/sub/HEAD:57d0df7269949ef6d5347c5a4556fde7eafef16d
.git/modules/other/sub/logs/HEAD:b0e43d8acf9fc38257b20ab7317b2b86110e8f72 57d0df7269949ef6d5347c5a4556fde7eafef16d Me
<me@hello.com> 1394764688 +0530 checkout: moving from master to 57d0df7269949ef6d5347c5a4556fde7eafef16d
Any idea why this is happening?
One answer at How do I git clone --recursive and checkout master on all submodules in a single line? suggests I might have pinned the submodule to particular sha, which the author says is the correct way to do. In my case, I want to get the latest, both in my main repo and all the submodules it refers to, when I do the clone.
How do I confirm if the submodule is pinned to the sha 57d0df7269949ef6d5347c5a4556fde7eafef16d? How do I remove it?
thanks.