diff options
author | John Ankarström <john@ankarstrom.se> | 2021-07-20 21:43:49 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-07-20 21:44:47 +0200 |
commit | 78d047863a86933693470a70ef6c0e6e07ecd4c5 (patch) | |
tree | 98d9a3d8b29a999fdc05430843f832c4157e5288 | |
parent | 4d31a80fe7b1e451a995f9e0a5cb8feaca5d00d5 (diff) | |
download | rbsd-78d047863a86933693470a70ef6c0e6e07ecd4c5.tar.gz |
Add /git/new script
-rwxr-xr-x | git/new | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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 |