projects
/
aoc-2021.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d6adaa1
)
feat(git): Add git hooks for sync remote.
author
sgf
<sgf.dma@gmail.com>
Wed, 8 Dec 2021 15:52:32 +0000
(18:52 +0300)
committer
sgf
<sgf.dma@gmail.com>
Wed, 8 Dec 2021 15:52:32 +0000
(18:52 +0300)
git_hooks/post-commit
[new file with mode: 0755]
patch
|
blob
diff --git a/git_hooks/post-commit
b/git_hooks/post-commit
new file mode 100755
(executable)
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