pre-receive
a pre-receive git hook that deploys the files in the _site directory#!/bin/sh
#
# pre-receive script for custom read/write-tree deploy
#
while read old new ref; do [[ $ref = refs/heads/trunk ]] && {
export GIT_INDEX_FILE="$GIT_DIR/deploy_index"
export GIT_WORK_TREE="$HOME/public_html/moments"
git read-tree -um $(git write-tree) $new:_site || exit 1
}; done