Generating bare Git repos

| | [C]olor

I use this script to set up bare git repos in my servers:

repo="$1"
git init --bare $repo
git --git-dir=$repo config core.sharedRepository group
chown -R git:git-group $repo
chmod -R gu+rwX $repo
find $repo -type d -exec chmod g+s '{}' +

then I can push to, pull from, and clone the git repo.