I have two remote repositories being managed by my local git repository:
- origin
- stage
I have a post-receive hook for each remote:
#!/bin/sh
git --work-tree=/var/www/REMOTENAME --git-dir=/var/repo/REMOTENAME.git checkout -f
However, when I push non-master branches, the work tree does not get updated. For example, if I have a branch called 'test', I would run:
git push stage test
and I would not see any changes on the remote's work tree.
If I run:
git checkout master
git merge test
git push stage master
I do see the changes on the remote's work tree.
My goal is to be able to use a workflow that allows me to separate development on multiple branches and push non-master branches to stage.
Any help would be greatly appreciated.