Git post-receive hook to update your website after commit
The assumption is that you have your repository for instance in: ~/repos/www.example.com/repository.git and your working copy of this repository in: ~/www.example.com In this case you have to create a file named post-receive in: ~/repos/www.example.com/repository.git/hooks and put following code inside it: #Update your website code GIT_WORK_TREE=/home/USER_NAME/www/www.example.com/ git checkout -f if you also are interested in re-creating… Read More »