]> git.phdru.name Git - git-scripts.git/blobdiff - hooks/post-update
Add post-update to update git-scripts after pushing to git-scripts.git
[git-scripts.git] / hooks / post-update
diff --git a/hooks/post-update b/hooks/post-update
new file mode 100755 (executable)
index 0000000..45de97e
--- /dev/null
@@ -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