Skip to content

Instantly share code, notes, and snippets.

@webflo
Created January 28, 2013 14:59
Show Gist options
  • Save webflo/4656156 to your computer and use it in GitHub Desktop.
Save webflo/4656156 to your computer and use it in GitHub Desktop.
git post commit hook with multiple branches
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
echo 'Changes pushed to master.'
fi
if [ "dev" == "$branch" ]; then
echo 'Changes pushed to dev.'
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment