< back

Just Some Git Magic


This might be trivial to some, but today I set up a special piece of Git magic for this website.

The Magic

Using a post-receive Git hook, I can have this website update automatically whenever I push a commit to its Git repository on this server.



git --work-tree=$DEPLOY_DIR --git-dir=$REPO_DIR checkout -f master

Beautiful, isn't it? With just a few lines of code, I've replicated the main function of something like GitHub Pages.

Remember KISS: Keep it simple, sisters!