kindwolf.org Git repositories xavierg-snippets / master create-git-repositories / create-public-repository
master

Tree @master (Download .tar.gz)

create-public-repository @masterraw · history · blame

1
2
3
4
5
6
#!/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"