#!/bin/bash
git_root='/srv/git/repositories'
[[ "${0}" == *"private"* ]] && git_mode='0660'
git init --bare --shared="${git_mode:-0664}" "${git_root}/${1}" || exit $?
vim "${git_root}/${1}/description"
perl -i -ple 's,^\s*denyNonFastforwards\s*=.*$, denyNonFastforwards = false,' "${git_root}/${1}/config"