aboutsummaryrefslogtreecommitdiff
path: root/scripts/util/new-repo.sh
diff options
context:
space:
mode:
authorben <ben@nagy.contact>2025-05-03 15:09:20 -0700
committerben <ben@nagy.contact>2025-05-03 15:09:20 -0700
commit564229f11b6a6b86a37379a8c6855f5033ce58a2 (patch)
tree91266a1d94bc8e5d1441d2a9c2f842601ffd57bd /scripts/util/new-repo.sh
parent19d17fd83dcfc0052c39fb8f06c34879473faadc (diff)
remote git scriptsmain
Diffstat (limited to 'scripts/util/new-repo.sh')
-rw-r--r--scripts/util/new-repo.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/util/new-repo.sh b/scripts/util/new-repo.sh
new file mode 100644
index 0000000..81841b4
--- /dev/null
+++ b/scripts/util/new-repo.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# this is run on remote
+
+if [ $# -ne 1 ]; then
+ echo "\nUsage: $0 'new-repo-name'\n"
+ exit 1
+fi
+
+echo "\nCreating new bare repository $PWD/$1"
+
+mkdir "$1" && git init --bare "$1"
+chmod -R u+rw "$1"/
+chown -R git:git "$1"
+
+echo "Adding post-receive hooks\n"
+cp /home/git/post-receive.sh "$1"/hooks/post-receive