noah
noah

Reputation: 21519

git - default push to --recurse-submodules=check

I always forget to push submodules. Sometimes I forget to add --recurse-submodules=check to git push. Even worse, others on my team might do the same. Is there a git config option we can set to make check the default?

Upvotes: 16

Views: 3101

Answers (2)

Mike Crowe
Mike Crowe

Reputation: 706

Git v2.7.0 adds support for the push.recurseSubmodules configuration option. It can be set to the same values as the --recurse-submodules command line options. For example:

git config push.recurseSubmodules check

means that subsequent invocations of git push will automatically check that submodules have been pushed.

Upvotes: 26

besen
besen

Reputation: 32470

You could try aliasing it.

git config alias.ps "push --recurse-submodules=check"

Then use

git ps

Upvotes: 16

Related Questions