Created
April 20, 2013 17:10
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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