Skip to content

Instantly share code, notes, and snippets.

@ejmr
Created November 15, 2015 13:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ejmr/453edc19dd596e472e90 to your computer and use it in GitHub Desktop.
Save ejmr/453edc19dd596e472e90 to your computer and use it in GitHub Desktop.
Update Git Submodules After Each Merge or Pull
#!/bin/sh
#
# This simple shell script is a Git hook that will automatically
# update all submodules any time you perform a merge or pull.
# This can be useful because you can do things like...
#
# $ git checkout master && git pull
#
# ...without having to remember to potentially update any
# submodules in the repository.
#
# To use this script save it as `.git/hooks/post-merge` in
# your repository and make the script executable, e.g. via
# `chmod +x .git/hooks/post-merge`.
##################################################################
git submodule update --init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment