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 hi开发者_如何学Cs 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.
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 .
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.
精彩评论