How to keep groups when pulling with git

Posted by mimrock on Server Fault See other posts from Server Fault or by mimrock
Published on 2012-11-16T13:48:54Z Indexed on 2012/11/20 11:07 UTC
Read the original article Hit count: 376

Filed under:
|
|

I have a staging site that is a working directory of a git repository. How to set up git to let a developer pull out a branch or release without changing the group of the modified files?

An example. Let's say I have two developers, robin and david. They are both in git-users group, so initially they can both have write permissions on site.php.

-rw-rw-r--  1 robin git-users   46068 Nov 16 12:12 site.php
drwxrwxr-x  8 robin git-users    4096 Nov 16 14:11 .git

After robin-server1$ git pull origin master:

-rw-rw-r--  1 robin robin       46068 Nov 16 12:35 site.php
drwxrwxr-x  8 robin git-users    4096 Nov 16 14:11 .git

And david do not have write permissions on site.php, because the group changed from 'git-users' to 'robin'. From now on, david will get a permission denied, when he tries to pull to this repository.

© Server Fault or respective owner

Related posts about linux

Related posts about git