It seems like by design git's submodule operations are manual. As a moderately-adept git user, I want to understand this design decision. In particular, it seems like the least surprising thing for git pull
or git checkout
to do is to check pull/check out the appropriate branch/comment, then update all submodules to match their corresponding commits. Why?
It appears that the above functionality is enabled if I set
[submodule]
recurse = true
in my ~/.gitconfig
. But even then, when a colleague adds a new module, when I git pull master
, I don't get the new module even though it shows up in .gitmodules
. If I check .gitmodules
for new ones and then do git submodule update --init MODULEPATH
, I get it. But again, why would this manual interaction be the desired behavior? When I pull
/checkout
, wouldn't I (almost?) always want all the modules update to match?
Bonus: Is there a way to automatically have git
fetch and check out new submodules? I.e., is there a Just Works mode for submodules. And if not, what do I not understand about the design of submodules that makes the default behavior desirable?