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
You need to read the arguments that are being passed to the script. That should have the branch name and new and old revisions and run for each branch pushed