This requires git 1.8.2 or later (March 2013)
It depends on how those submodules are declared in the .gitmodules
:
See "git submodule tracking latest"
That would allow you to follow the master branch.
Update your current .gitmodules
with a:
git config -f .gitmodules submodule.<path>.branch master
git submodule update --remote --recursive
Note that the submodule still won't be on any branch. Simply their SHA1 would be the one of origin/master
.
You would still need to checkout master
for each of them.
git submodule foreach --recursive git checkout master