Skip to content

Instantly share code, notes, and snippets.

@sriedel
Created October 20, 2010 05:59
Show Gist options
  • Save sriedel/635848 to your computer and use it in GitHub Desktop.
Save sriedel/635848 to your computer and use it in GitHub Desktop.
Post Commit hook to auto-update submodules
#!/bin/bash
pushd . # save current place in filesystem
until [ -d .git ] || $(pwd) = "/" ; do # look for project root
cd ..
done
if [ -d .git ] ; then # if we found it...
git submodule update
fi
popd # reset to original place in filesystem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment