Skip to content

Instantly share code, notes, and snippets.

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 mkozjak/a19a754840f9b7e6afe6c96a312cce58 to your computer and use it in GitHub Desktop.
Save mkozjak/a19a754840f9b7e6afe6c96a312cce58 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