Skip to content

Instantly share code, notes, and snippets.

View AoiYamada's full-sized avatar
:octocat:

AoiYamada AoiYamada

:octocat:
View GitHub Profile
@AoiYamada
AoiYamada / post-receive.sh
Created December 11, 2019 17:07 — forked from benfrain/post-receive.sh
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