From: sgf Date: Mon, 1 Aug 2022 14:46:50 +0000 (+0300) Subject: Add sync commit hook. X-Git-Url: https://gitweb.sgf-dma.tk/?a=commitdiff_plain;h=2532a2a2bd3e5da308f88e54a4b150ed723568dd;p=mir_japanese-words.git Add sync commit hook. --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4298e22 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.~*# diff --git a/git_hooks/post-commit b/git_hooks/post-commit new file mode 100755 index 0000000..f5002cd --- /dev/null +++ b/git_hooks/post-commit @@ -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