Skip to content

Instantly share code, notes, and snippets.

@physacco
Created April 20, 2013 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save physacco/5426682 to your computer and use it in GitHub Desktop.
Save physacco/5426682 to your computer and use it in GitHub Desktop.
Git post-receive hook for auto-updating a static website generated by nanoc. Nanoc project path is /home/www/mysite; the docroot is /home/www/mysite/output.
#!/bin/sh
# Unset GIT_DIR or you will get a `fatal: Not a git repository: '.'` error.
# Refer to: http://stackoverflow.com/questions/10507942/git-checkout-in-post-receive-hook-not-a-git-repository
unset GIT_DIR
cd /home/www/mysite || exit
git pull
nanoc compile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment