I manage a repository with several submodules. For a while now I've been using
$ git submodule foreach git pull origin master
to pull in the latest changes for all of these guys. However, recently I learned about
$ git pull --recurse-submodules
and gave it a try but it seems that changes are only fetched so you need to
$ git submodule update --recursive
in order to actually checkout the changes. However, this last seems to do nothing in my repository despite submodules clearly pulling changes. I also noticed that my submodules are checked out to some commit instead of master or whatever branch.
- Am I doing something improperly?
- Or is this an artifact of the
foreach
way I used to do things? - How can I fix things up so that
pull --recurse-submodules
andsubmodule update --recursive
work as expected?