Skip to content

Instantly share code, notes, and snippets.

@jmoz
Created November 26, 2012 18:57
Show Gist options
  • Save jmoz/4149929 to your computer and use it in GitHub Desktop.
Save jmoz/4149929 to your computer and use it in GitHub Desktop.
Git post-receive for jmoz.co.uk
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
echo Update to branch $branch
if [ "master" == "$branch" ]; then
echo "git checkout -f master branch!!!"
unset GIT_DIR
GIT_WORK_TREE=/home/web/sites/jmoz.co.uk git checkout -f
bash /home/web/sites/jmoz.co.uk/install.sh
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment