From: Oleg Broytman Date: Fri, 28 Sep 2018 15:05:54 +0000 (+0300) Subject: Add post-update to update git-scripts after pushing to git-scripts.git X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=commitdiff_plain;h=3d9718102201b0be6ab314ca7a336d8791aba6b2 Add post-update to update git-scripts after pushing to git-scripts.git --- diff --git a/hooks/post-update b/hooks/post-update new file mode 100755 index 0000000..45de97e --- /dev/null +++ b/hooks/post-update @@ -0,0 +1,11 @@ +#!/bin/sh +# Update git-scripts after pushing to master at git-scripts.git. +# This hook must be in git-scripts.git/hooks/post-update. + +for ref in "$@"; do + if [ "$ref" = refs/heads/master ]; then + unset GIT_DIR + cd ../git-scripts && + exec git pull ../git-scripts.git master + fi +done