Labels

Wednesday, August 14, 2013

Setup Git Repository

I created a Git server to host our companies code repositories.  It is an ubuntu server with ssh enabled and git installed.  Here are steps I use to create a new repository:
1. Create directory to host new repository
$ sudo mkdir /testrepo1
2. Change group of repository directory to group used by developers that will be using this repository
$ sudo chgrp -R git /testrepo1
3. Change default permissions on directory so that all new files will be crated with the new group
$ sudo chmod g+rws /testrepo1
$ sudo git --base /testrepo1
4. Initialize empty Git repository
$ cd /testrepo1
$ git --bare init --shared=group