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
www-data
git
Remove the repository owned by www-data and follow the solution on this webpage for setting up a post-receive hook in the repository owned by git.