How to git clone all submodules (using --recursive) except one?

Viewed 700

Is there a way to use git clone --recursive to clone a project including all of it's submodules, except one (manually specified) submodule? Thank you!

1 Answers

git clone --recurse-submodules takes an optional pathspec. This pathspec can be negative (e.g., !*.c) to match all files but a particular path. See gitglossary(7) for the form of pathspecs. You may need to specify --recurse-submodules=. and the add an additional negative pathspec version as well.

Related