Skip to content

Instantly share code, notes, and snippets.

@gx86
Created February 6, 2014 05:52
Show Gist options
  • Select an option

  • Save gx86/8838971 to your computer and use it in GitHub Desktop.

Select an option

Save gx86/8838971 to your computer and use it in GitHub Desktop.
post-receive hook to update site
#!/bin/bash
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ "master" == "$branch" ]; then
GIT_WORK_TREE=PATH/TO/SITE checkout -f
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment