Add sync commit hook.
authorsgf <sgf.dma@gmail.com>
Mon, 1 Aug 2022 14:46:50 +0000 (17:46 +0300)
committersgf <sgf.dma@gmail.com>
Mon, 1 Aug 2022 14:46:50 +0000 (17:46 +0300)
.gitignore [new file with mode: 0644]
git_hooks/post-commit [new file with mode: 0755]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..4298e22
--- /dev/null
@@ -0,0 +1 @@
+.~*#
diff --git a/git_hooks/post-commit b/git_hooks/post-commit
new file mode 100755 (executable)
index 0000000..f5002cd
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -euf
+
+remotes="$(git remote)"
+if echo "$remotes" | grep -q 'sync'; then
+    git push --all sync
+    git push --tags sync
+else
+    echo ">>>>> No sync remote defined." 1>&2
+fi