This could be solved reasonably well with ACLs. Give the git user selective write to the tree rooted at /srv/www/helloworld.
Re:Deploy a website using git in Ubuntu
by binarydreams on Monday June 04, 2012 @11:57PM
(#4067247)
but the plan/aim is to make it all very simple to setup (even for noobs :)). cmon, ACL knowledge is not something wide spread.
So, we need to keep things simpler!
Sometimes there's a limit to how simple something can be. And sometimes you don't want to/shouldn't hide the complications.
I think that introducing users to ACLs, permissions and security is appropriate at this step. You can have a script/process in place that can take care of this but you should explain what's going on and why. Because if there's a security issue, they can at least have some kind idea of what happened.
what if the "bare" git repo (/srv/git/helloworld.git) belongs to a user "git" and the non-bare setup (/srv/www/helloworld) belongs to use "conradev" ? this (different users) setup is what one would prefer when multiple people are working on the project.
git pull hub master would fail in that case as it would be executed by the git user. so you'll probably have a lot of hard time figuring out permissions. what are your suggestions now ?