aboutsummaryrefslogtreecommitdiff
path: root/scripts/util/new-repo.sh
blob: 81841b4e915abcbbe3b3f8ee0511e22e8f5d9d16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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