Git‎ > ‎Git Tricks‎ > ‎

Convert Bare Repository to Shared

Our dev team decided to convert our existing three CVS repositories into one git repository.  I used git init --bare instead of git init --bare --shared and started pushing tons of commits into the repository.  When it came time for everyone else to use it, they could all pull from the repository but were facing errors when trying to push.  We used group-level permissions on a Linux box and I had to change the repository so they had the proper access.  I messed it up a couple times and finally came up with these instructions.  Because people were able to partially get their changes in, these instructions cover some of the additional headaches I had to solve.  Let's assume that the group is going to be called gitusers.

cd /usr/share/git/my_bare_repo.git
git config core.sharedRepository true
chgrp -R gitusers .
chmod g+rw -R .
find . -type d -exec chmod g+x .
Comments