Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 316 Bytes

update-submodules-on-branch-change.md

File metadata and controls

17 lines (12 loc) · 316 Bytes

Update submodules in Git post checkout hook

Put the following in .git/hooks/post-checkout

#!/bin/bash

cd ./$(git rev-parse --show-cdup)
git submodule foreach git reset --hard HEAD
git submodule update

then, make the post-checkout file executable using:

chmod +x .git/hooks/post-checkout