Skip to content

Instantly share code, notes, and snippets.

@ravenscroftj
Created January 20, 2012 10:11
Show Gist options
  • Save ravenscroftj/1646546 to your computer and use it in GitHub Desktop.
Save ravenscroftj/1646546 to your computer and use it in GitHub Desktop.
Initialise a shared git repository in BASH
#!/bin/bash
if [ $# -lt 2 ]
then
echo "Usage: $0 <path/to/repository> <GitGroupName>"
exit 0
fi
#make the directory
mkdir $1
#init the repository
git init --bare --shared $1
#make sure the repository is shared amongst the git group
chgrp -R $2 $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment