Permission problem with Git (over SSH) on FreeBSD
Posted
by vpetersson
on Server Fault
See other posts from Server Fault
or by vpetersson
Published on 2010-03-26T19:46:58Z
Indexed on
2010/03/26
19:53 UTC
Read the original article
Hit count: 338
We're having permission problem with Git on FreeBSD. The setup is fairly straight forward. We have a few different repos on the same server. For simplicity, let's say they reside in /git/repo1 and /git/repo2.
Each repo is owned by the user 'git' and a self-titled group (eg. repo1). The repo is configured with g+rwX access.
Every user who commits to the repository is also member of the group for the repo (eg. repo1).
The Git repositories all have 'sharedRepository = group' set.
So far so good, all users can check out the code from the repositories, and the first user can commit without any problem. However, when the next user tries to commit to the repositories, he will receive a permission error.
We've been banging our heads with this issue for some time now, and the only way we've managed to resolve it is by running the following script between commits (which is obviously very inconvenient):
find /git/repo1 -type d -exec chmod g+s {} \;
chmod -R g+rwX /git/repo1
chown -R git:repo1 /git/repo1/
cd /git/repo1
git gc
Anyone got a clue to where the problem lies?
© Server Fault or respective owner