I used to use commands like
git submodule foreach git status
or for commands that may fail
git submodule foreach "git checkout develop || true"
So now I created a alias for the first form and it works OK
git config --global alias.all '!f(){ git submodule foreach "git $@"; }; f'
I then try to do it also for the second form and it doesn't work at all
git config --global alias.all '!f(){ git submodule foreach "git $@ || true"; }; f'
Note that I can still use it the first one like
git all "checkout develop || true"
but that looks like unnecessary typing when using an alias.
The error it gives in the example above using 'git all' is error: pathspec 'develop || true' did not match any file(s) known to git
while in the 'submodules' it outputs an error but it continues to the next submodule.
Any pointer on how to fix that second version?
Cheers.