8

I created a Git repo on a server and want it to be used by several people, i.e. users which belong to the same Unix group. It also has a working copy because it may be useful for us to have a common working copy.

Thus I set the owning group of that Git repo directory to that Unix group.

The problem is, every time someone is pushing to that repository, the new files/directories have the owner set to the username of that user and his group but not our common group. Also, all those new files/directories become rwxr-xr-x.

I tried git config core.sharedRepository group but that doesn't really work. It now makes files/directories as rwxrwsr-x but is has still the wrong group set.

Albert
  • 65,406
  • 61
  • 242
  • 386

2 Answers2

12

Ok, figured it out.

The first important thing (which I did already) was:

git config core.sharedRepository group

The second one was this:

chmod g+s -R .
Albert
  • 65,406
  • 61
  • 242
  • 386
2

I would highly recommend you use gitolite for any rights management within an organization and git. This has made management of the repos so much easier.

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141