It is possible to write a post-update hook which detect the branch name.
See for inspiration:
- “Writing a
git post-receive
hook to deal with a specific branch” - “Find Git branch name in post-update hook“
As an example (all those hooks are based on git rev-parse
):
#!/bin/bash
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ "master" == "$branch" ]; then
# Do something
fi
done