I have found several posts on SO talking about deploying web projects with git.
Most are not too recent, but there seem to be a link usually appreciated.
This little tutorial suggests to use the GIT_WORK_TREE
functionality to allow detaching the remote working tree on the web server directory.
The aim is to be able to git push web
from the local repository to put modifications directly in production.
What I'm wondering is how should I manage my users/groups in the remote server to allow the deployment.
Mainly 2 questions:
/var/www/my_project
directory ?Yes, the tutorial should work, but remember that /var/www/my_project is to be writable by the (remote) user who will push the commits since hooks are run with the same uid/gid.
Otherwise, if you need more people to being able to push to the site, you would need them to use another user or to use gitolite or similar tools.