Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cfreeman/5105488 to your computer and use it in GitHub Desktop.
Save cfreeman/5105488 to your computer and use it in GitHub Desktop.
Setting up remote git repository where users that belong to the nominated group will have read/write access.

How to a create git repository with group read/write permissions

Configure your server.

$ ssh myserver.com
Welcome to myserver.com!
$ mkdir /var/git/myapp.git
$ chgrp grpName /var/git/myapp.git
$ chmod 775 /var/git/myapp.git
$ chmod g+s /var/git/myapp.git
$ cd /var/git/myapp.git
$ git --bare init --shared=group
Initialized empty Git repository in /var/git/myapp.git
$ exit

Add the remote repository to your existing local git repo and push

$ cd ~/Sites/myapp
$ git remote add origin ssh://myserver.com/var/git/myapp.git
$ git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment