views:

28

answers:

1

I have an existing git repo (a bare one) which has up to this point only been writable by me. I want to open it up to some UNIX user group, foo, so that all members of foo can push to it. I'm aware that I can easily set up a new git repo with:

git init --bare --shared=group repodir
chgrp -R foo repodir

But I need the equivalent operation for an existing repo dir.

+4  A: 

Try this to make an existing repo in repodir work for users in group foo:

chgrp -R foo repodir                # set the group
chmod -R g+rw repodir               # allow the group to read/write
chmod -R g+s `find repodir -type d` # set directories' sticky bits
David Underhill
I would add that you probably should also set config.sharedRepository = true in the repo's config. http://www.kernel.org/pub/software/scm/git/docs/git-config.html
Pistos
Yes, good point. Thanks for pointing that out Pistos!
David Underhill
This is pretty close to what I was doing on my own, but I wanted to get some external confirmation. Thanks. :) I was also hoping there would be a git clone --shared=group sort of thing, but clone's --shared option does something completely different.
Pistos