Skip to content

Instantly share code, notes, and snippets.

@craigfurman
Created October 16, 2017 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigfurman/62b5a7189c18c7e503a0ebb300207fe8 to your computer and use it in GitHub Desktop.
Save craigfurman/62b5a7189c18c7e503a0ebb300207fe8 to your computer and use it in GitHub Desktop.
Push all submodules, old school
#!/bin/bash
set -euo pipefail
for sub in $(git submodule | awk '{print $2}'); do
(
cd "$sub"
if git status | grep "Your branch is ahead of" >/dev/null 2>&1 ; then
git push
fi
)
done
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment