I\'ve got a post receive hook setup on the remote repo that tries to determine the branch name of the incoming push as follows:
$branch = `git rev-parse --abbrev
Both these answers are correct, but I was having trouble getting stdin to the next common function post-receive-email. Here is what I ended up with:
read oldrev newrev ref
echo "$oldrev" "$newrev" "$ref" | . /usr/share/git-core/contrib/hooks/post-receive-email
if [ "refs/heads/qa" == "$ref" ]; then
# Big Tuna YO!
wget -q -O - --connect-timeout=2 http://127.0.0.1:3000/hooks/build/qa_now
fi