Created
April 23, 2020 18:21
-
-
Save kriscooke/b4f3e9a2ce52fa406c48d0e5bee1cbe8 to your computer and use it in GitHub Desktop.
Keep Git submodules in the right state when switching branches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://ttboj.wordpress.com/2014/05/06/keeping-git-submodules-in-sync-with-your-branches/ | |
# Create a file in your project's hooks: touch .git/hooks/post-checkout | |
# And add the following: | |
#!/bin/bash | |
exec git submodule update | |
# Then chmod u+x .git/hooks/post-checkout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment