Skip to content

Instantly share code, notes, and snippets.

@benfrain
benfrain / post-receive.sh
Last active June 8, 2024 20:52
post-receive hook for multiple branches
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
git --work-tree=./path/under/root/dir/live-site/ checkout -f $branch
echo 'Changes pushed live.'
fi