15

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?

noah
  • 21,289
  • 17
  • 64
  • 88

2 Answers2

25

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.

Mike Crowe
  • 642
  • 6
  • 18
16

You could try aliasing it.

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

Then use

git ps
noah
  • 21,289
  • 17
  • 64
  • 88
besen
  • 32,084
  • 1
  • 21
  • 12
  • 6
    Yea, that's what I'm doing. But it would be better if we could default the real push to doing that. – noah Oct 02 '12 at 12:52
  • Or if `alias.push` overrode the command, but that doesn't seem to work – nmr Dec 02 '15 at 02:09