#!/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