aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit/new14
1 files changed, 14 insertions, 0 deletions
diff --git a/git/new b/git/new
new file mode 100755
index 0000000..0f4d949
--- /dev/null
+++ b/git/new
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+
+[ -z "$1" ] && { echo usage: $0 name 1>&2; exit 1; }
+
+# create new repository
+name=${1%.git}
+git init --shared=group --bare /git/"$name"
+chown -R git:git /git/"$name"
+cp /git/"$name"/hooks/post-update.sample /git/"$name"/hooks/post-update
+cd /git/"$name"
+git update-server-info
+sed -i '/receive\|denyNonFast/d' /git/"$name"/config
+${EDITOR:-vi} /git/"$name"/description