For over a year, I've been having troubles with GIT and directory/file permissions. I have a central repository to which multiple developers push code, using ssh (origin set up as ssh://example/git/repository). I have set up the repository as follows:
1) My config file in the central repository: [core] repositoryformatversion = 0 filemode = true bare = true sharedrepository = 0660
2) All repository directory permissions are set to 770 (rwxrwx---) 3) All files in ./objects/XX and ./objects/info are set to 440 (r--r-----) 4) All other files are set to 660 (rw-rw----) 5) Ownership is set to root:group_name
(note that this came from the reccomended setup in the top response in this thread: Making git push respect permissions?)
All accessing users are members of the group 'group_name'.
The problem is that if user1 pushes to the repository, the file ownership on some files are set to user1:user1 - meaning that the group is changed. Once this happens, no other users can push (or pull) from the repository, as they do not have permission to read, write or execute from required files in the repository anymore.
I have read every thread I can find regarding the matter on Stack Overflow and pretty much everywhere else on the net, but I keep running into this same issue.
The problem is, I'm not sure if this issue is one of GIT, or one of UNIX, and I'm not sure how to fix it. How can I stop the group from being changed when a user pushes to the repository?