summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-10-15 16:18:19 -0400
committerRaghuram Subramani <raghus2247@gmail.com>2025-10-15 16:18:19 -0400
commita78560944934d7728ae8d2949a5201487c0e4867 (patch)
treed035c1158bf39de04c7ed4e2e45744f6b2effde0 /init
parent794e1951e4817c812d5d1897b43df92b91fbd581 (diff)
add hooks to clones
Diffstat (limited to 'init')
-rwxr-xr-xinit5
1 files changed, 5 insertions, 0 deletions
diff --git a/init b/init
index 34e48a5..61605c0 100755
--- a/init
+++ b/init
@@ -5,6 +5,8 @@ if [ $# -ne 1 ]; then
exit 1
fi
+set -xe
+
base_dir="$HOME"
new_repo="${base_dir}/$1"
@@ -24,3 +26,6 @@ fi
mkdir "$new_repo"
git init --bare "$new_repo" >/dev/null 2>&1\
&& echo "Initialized empty Git repository: git@$(uname -n):$1"
+
+echo 'git push github -f --mirror' > "$new_repo/hooks/post-receive"
+chmod +x "$new_repo/hooks/post-receive"