Skip to content

Instantly share code, notes, and snippets.

@rlane
Created March 25, 2014 22:25
Show Gist options
  • Save rlane/9772766 to your computer and use it in GitHub Desktop.
Save rlane/9772766 to your computer and use it in GitHub Desktop.
update submodules
#!/bin/bash
for S in submodules/*; do
echo "Updating $S"
git -C $S checkout --quiet master
git -C $S pull --quiet origin master
if ! git diff --quiet $S; then
(echo "update $(basename $S)"; echo; git submodule summary $S) | git commit -F- $S
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment