I have a Git project that it’s a bit special because the files in the tree are generated by two different users. Example:
# ls -la
drwxr-xr-x 13 ivan ivan 4096 2012-02-02 16:52 .
drwxrwxrwx 32 root root 4096 2012-01-28 21:37 ..
drwxr-xr-x 2 ivan ivan 4096 2012-02-07 20:41 system
drwxr-xr-x 2 ivan ivan 4096 2012-02-07 20:41 compatibility
drwxr-xr-x 33 ivan ivan 4096 2011-12-08 18:13 resources
drwxr-xr-x 8 ivan ivan 4096 2012-02-07 20:41 .git
-rw-r--r-- 1 ivan ivan 307 2012-02-02 16:52 .gitignore
-rw-r--r-- 1 bulk bulk 700 2011-11-01 20:10 base.log
.....
Git is controled just by one user (ivan) but a daemon produces files assigned to bulk user. Everything was well whilst the daemon added new files, but when the daemon changed a file, git stopped working saying:
error: unable to unlink old 'base.log' (Permission denied)
I know the best option is to make the daemon run as ivan user, but that’s technically difficult. The question is: is there any way to deal with this kind of situations in Git? I mean, I just want to do “git checkout branch” without having problems with user permissions.
Add you git user (ivan) to the ‘bulk’ group.
Debian:
Others (FC, Redhat and similar?):
Everything should be fine. To have write access (i.e. so you can checkout, merge etc. you working tree), change permissions to allow the goup write access:
Alternatives:
bup