Skip to content

Instantly share code, notes, and snippets.

@SamjiDiamond
SamjiDiamond / post-receive.sh
Created Nov 30, 2020 — forked from benfrain/post-receive.sh
post-receive hook for multiple branches
View post-receive.sh
#!/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