diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2016-06-07 11:35:28 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2016-06-07 11:35:28 +0300 |
commit | 0307095636644e16d9443ec5d7e179068755ca05 (patch) | |
tree | 378832f1b96073196ed04fb53f3d1a8c65940d8f /install_dev_githooks.sh | |
parent | dc258685f712aeb6784a84425d6391154ffd4a07 (diff) |
wip
Diffstat (limited to 'install_dev_githooks.sh')
-rwxr-xr-x | install_dev_githooks.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/install_dev_githooks.sh b/install_dev_githooks.sh index ace3cb0b..b43dd6a0 100755 --- a/install_dev_githooks.sh +++ b/install_dev_githooks.sh @@ -1,8 +1,11 @@ #!/bin/sh -echo Installing post-receive hook which recursively forces all +echo Installing post-merge hook which recursively forces all echo submodules to latest commit after every git pull cat <<EOT >> .git/hooks/post-merge #!/bin/sh git submodule foreach --recursive 'branch=\$(git config -f \$toplevel/.gitmodules submodule.\$name.branch); [ \"\$branch\" = \"\" ] && branch=master; git checkout \$branch; git merge origin/$branch;' EOT chmod +x .git/hooks/post-merge +echo Installing custom 'git pull-all' command for recursively +echo forcing all submodules to latest commit +git config alias.pull-all "submodule foreach --recursive 'branch=\$(git config -f \$toplevel/.gitmodules submodule.\$name.branch); [ \"\$branch\" = \"\" ] && branch=master; git checkout \$branch; git pull;'" |