So, I have a staging server setup, and what I would like to do is when someone pushes to a non master branch update what the staging server's directory. My current post-receive hook looks like:
echo "post hook is on the run!"
while read oldrev newrev ref
do
echo "$ref"
done
unset $(git rev-parse --local-env-vars)
cd ../staging/bikereport
git fetch
git pull origin $ref
echo "Post receive finsihed"
However I am not seeing the changes I would like on the server, and remote returns "Already up-to-date" which makes me think it's pulling from Master or something?
This isn't an elegant solution, but we are a very small team working on a single project. An ideal solution would be to save every branch to a new directory within the staging server and then update only that directory per push.