Make `git clone` automatically checkout submodules

53 Views Asked by At

The majority of the git repos I've been working with over the last few years use submodules. It's not an insignificant cognitive load for me and other users to include --recurse-submodules every time I check out (and remind others to do the same), lest they have to recall the dreaded command git submodule update --init --recursive that most users seem to need to look up to remember.

To clarify - I know how to check out things recursively, I am looking for a solution to prevent human error / cognitive load when checking out repos.

Is there some way I can globally change the default git behavior to checkout submodules when cloning repositories? Preferably without an alias since I frequently work in Linux and Windows?

This answer suggests git config submodule.recurse true but that does not support the clone command. Is there an alternative?

0

There are 0 best solutions below