Git saves deletion of write rights to a group

I have a git repository that I use with several developers. We do regular git pulls and pushes it. Unfortunately, every time I do git, pull out the modified files, losing the write permissions of the group. How to stop git from doing this?

I am running this on Ubuntu 12.04 LTS.

The shared repo configuration is as follows:

[core] repositoryformatversion = 0 filemode = true bare = true sharedRepository = group 

I also ran the following commands on it, trying to fix it

 find repo.git -type d -exec chmod g+rws {} + sudo chmod -R g+rw repo.git/objects 

No matter what I get with folders with 755 and files with 644, when I want 775 and 664 respectively.

+4
source share
3 answers

you can do it on a git hook with something like this:

 #!/bin/sh # # .git/hooks/post-merge sudo chmod -R g+rw * 

it is called after every git tag, and the file (.git / hooks / post-merge) must be executable

+2
source

You should use the settings core.sharedRepository=group or core.sharedRepository=0664 .

See http://criticallog.thornet.net/2010/01/07/sharing-your-git-repository/

+1
source

The users in question should also set their umask to 002.

0
source

All Articles