GIT_WORK_TREE not only updating 1 file <p>I have set up a two bare git repository's on my server with file paths like so:</p> <p>/git/project.git/ <br> /git/project2.git/</p> <p>I then have added two branches dev and live. I then added the following post-receive hook to each project</p> <pre><code>` #!/bin/sh while read oldrev newrev refname do echo "STARTING [$oldrev $newrev $refname]" if [ "$refname" == 'refs/heads/dev' ] then GIT_WORK_TREE=/var/www/vhosts/devwebsite.com/httpdocs/ git checkout -f elif [ "$refname" == 'refs/heads/live' ] then GIT_WORK_TREE=/var/www/vhosts/livewebsite.com/httpdocs/ git checkout -f fi done` </code></pre> <p>This works on 1 project but not the other. On the second project it only seems to work with my first file I pushed which happens to be a .gitignore file.</p> <p>So in short this file is the only file that will be updated when I push.</p> <p>Thanks in a advance for any help you can give.</p>