Skip to content

Instantly share code, notes, and snippets.

@juemura
Created November 2, 2015 22:56
Show Gist options
  • Save juemura/d938bd44d57901e4b9cc to your computer and use it in GitHub Desktop.
Save juemura/d938bd44d57901e4b9cc to your computer and use it in GitHub Desktop.
this is the post-receive in hooks in the remote server (old)
#!/bin/bash
#
docroot="/var/www/html"
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
git --work-tree=$docroot checkout -f $branch
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment