Skip to content

Instantly share code, notes, and snippets.

@chefe
Created June 3, 2014 10:55
Show Gist options
  • Save chefe/06bdfb5f5345a74670cb to your computer and use it in GitHub Desktop.
Save chefe/06bdfb5f5345a74670cb to your computer and use it in GitHub Desktop.
post-receive hook for generating a webpage
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
git archive --format=tar --prefix=$branch/ $branch | (cd ../web && tar xf -)
echo "The page for $branch was successfully updated"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment