On my server, I have two users, www-data (which is used by nginx) and git. The git user owns a repository that contains my website's code, and the www-data user owns a clone of that repository (which serves as the webroot for nginx). I want to set up a workflow such that pushing to git's repository causes www-data's repository to update, thus updating my website.
What is the correct way to set up the hooks for these repositories (that also takes into consideration privileges and permissions of these two users)?
git, and make it readable by everyone? That would also simplify the permission issues in this question...gittowww-datarepos. :) Do you prefer having two git repos on the server? Another option is to set the group ownership of the files to be one of the server's groups, and allow read access through group privileges.