Skip to content

Instantly share code, notes, and snippets.

@rsmarshall
Created May 15, 2015 10:41
Show Gist options
  • Save rsmarshall/91a1e33649689ef58342 to your computer and use it in GitHub Desktop.
Save rsmarshall/91a1e33649689ef58342 to your computer and use it in GitHub Desktop.
git hook
#GIT_WORK_TREE=/var/www/us git checkout -f
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
# branch=`echo $1 | cut -d/ -f3`
GIT_WORK_TREE=/var/www/us git checkout -f $branch
done
unset $(git rev-parse --local-env-vars)
exec git update-server-info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment