Deploying site with Git: post-update hook works first time, then never again
问题 Having a strange issue with a git post-update hook. I created repository on my server ( /var/www/vhosts/git/master.git ) and in this repository added a post-update hook with the following code: #!/bin/sh echo $1 echo "*UPDATE*" case " $1 " in *'refs/heads/master'*) GIT_WORK_TREE=/var/www/vhosts/website.com/sandbox.website.com git checkout -f echo echo "Master was updated!" echo ;; esac case " $1 " in *'refs/heads/sandbox'*) GIT_WORK_TREE=/var/www/vhosts/website.com/sandbox.website.com git