Skip to content

Instantly share code, notes, and snippets.

@webflo
Created January 28, 2013 15:02
Show Gist options
  • Save webflo/4656169 to your computer and use it in GitHub Desktop.
Save webflo/4656169 to your computer and use it in GitHub Desktop.
git post-receive hook with multiple branches.
#!/bin/bash
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ "master" == "$branch" ]; then
# Do something
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment