I have a project with a lot of submodules and I want to delete all remote branches named foo in the submodules, if it exists.
I am trying to following:
git submodule foreach git push origin :foo
This works as intended if the branch exists in all submodules, but if any of the submodules is missing the branch, the foreach stops:
Stopping at 'modules/bar'; script returned non-zero status.
How do I suppress the error?