From 8e99f17c96b1f49a6daffafc98a99688536a002b Mon Sep 17 00:00:00 2001 From: sgf Date: Wed, 12 Apr 2023 17:55:10 +0300 Subject: [PATCH] Add git hooks for sync remote --- git_hooks/post-commit | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 git_hooks/post-commit diff --git a/git_hooks/post-commit b/git_hooks/post-commit new file mode 100755 index 0000000..5454b5c --- /dev/null +++ b/git_hooks/post-commit @@ -0,0 +1,10 @@ +#!/bin/sh + +set -euf + +remotes="$(git remote)" +if echo "$remotes" | grep -q 'sync'; then + git push --all sync +else + echo ">>>>> No sync remote defined." 1>&2 +fi -- 2.20.1