Get `git commit -a` to ignore submodules?

Solution 1:

You can set the submodule.ignore in git config or in the .gitmodules file.

NOTE: GIT is kind of stupid with this. If you set ignore = all, to get sane behavior with git commit -a, it will ALSO ignore the submodule in git show/diff when you EXPLICITLY add them. The only way to work-around the latter is using the command line option --ignore-submodule=none.

NOTE2: The diff.ignoreSubmodules config is supposed to be able to set the default command line option --ignore-submodule, but has been broken for years, and does nothing as .gitmodules wins the contest, so only explicit command line options will get you sane behavior.