#!/bin/sh set -e die() { echo "$*" 1>&2 exit 1 } [ -z "$1" ] && die "usage: newrepo NAME" [ ! -e "$HOME/git" ] && ln -sf "/var/git/$USER" "$HOME/git" NAME="$1" REPO="$HOME/git/${NAME}.git" git init --bare "$REPO" echo "$USER" > "${REPO}/owner" echo "git://git.garbash.com/${USER}/${NAME}" > "$REPO/url" touch "$REPO/git-daemon-export-ok" printf "description: " read desc echo "$desc" > "$REPO/description" cp /var/git/stagit-post-receive "$REPO/hooks/post-receive" echo "" echo "Done! Clone with:" echo " git clone ${USER}@git.garbash.com:git/${NAME}.git"