]> git.phdru.name Git - git-scripts.git/blobdiff - copy-scripts/post-update
Add `copy-scripts/`: Copy this repo to a remote host
[git-scripts.git] / copy-scripts / post-update
diff --git a/copy-scripts/post-update b/copy-scripts/post-update
new file mode 100755 (executable)
index 0000000..78fc50d
--- /dev/null
@@ -0,0 +1,14 @@
+#!/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 &&
+      git checkout master &&
+      git pull origin master &&
+      git push origin master
+      exit
+   fi
+done