diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2016-06-06 14:23:33 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2016-06-06 15:03:50 +0300 |
commit | 9035c698e9b8067ac612efd9d813a1ee98939d5f (patch) | |
tree | 8c999bc17f3e1b42c02615ac9d0c538dd8590ce3 /install_dev_githooks.sh | |
parent | 0f5523a492e61a7946a76b6cb4b3738c16773c3a (diff) |
Ensure submodules are recursively updated on pull
Diffstat (limited to 'install_dev_githooks.sh')
-rw-r--r-- | install_dev_githooks.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/install_dev_githooks.sh b/install_dev_githooks.sh new file mode 100644 index 00000000..ed417821 --- /dev/null +++ b/install_dev_githooks.sh @@ -0,0 +1,8 @@ +#!/bin/sh +echo Installing post-receive hook which recursively forces all +echo submodules to latest commit after every git pull +cat <<EOT > .git/hooks/post-receive + #!/bin/sh +git submodule foreach --recursive 'branch=\$(git config -f \$toplevel/.gitmodules submodule.\$name.branch); [ \"\$branch\" = \"\" ] && branch=master; git checkout \$branch; git merge FETCH_HEAD' +EOT +chmod +x .git/hooks/post-receive |