Skip to content

Instantly share code, notes, and snippets.

@t-mart
Last active October 15, 2015 04:27
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 t-mart/4535678144f529d66333 to your computer and use it in GitHub Desktop.
Save t-mart/4535678144f529d66333 to your computer and use it in GitHub Desktop.
A script to pull submodules to their origin/master. Meant to be used as a git hook.
#!/bin/sh
#
# To enable this hook, place this file at:
# <repo-base-dir>/.git/hooks/pre-commit
printf "Updating submodules to origin master..." >&2
git submodule update --rebase --remote
STATUS=$?
if [ $STATUS -eq 0 ]; then
echo "done" >&2
else
echo "error!" >&2
fi
exit $STATUS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment