Creating and using bare git repositories
Good for writing shared papers in LaTeX!
In the host which you want to keep the bare repo, login and do the following:
Here the host is students server of iit mandi and the group is students.
$ mkdir paper
$ cd paper/
$ git init --bare globalsip.git
$ cd globalsip.git/
$ chgrp -R students .
$ chmod -R g+rwX .
$ find . -type d -exec chmod g+s '{}' +
The above is a one-time init of the bare repo.
In the hosts where you want to keep the working directories, do the following:
git clone ssh://username1@hostname1//path/to/globalsip2016/paper/globalsip.git
You may need to run:
git config core.sharedRepository group
in your working directory.
git clone ssh://username2@hostname2//path/to/globalsip2016/paper/globalsip.git
Then use git as usual!
Source: http://stackoverflow.com/questions/6448242/git-push-error-insufficient-permission-for-adding-an-object-to-repository-datab