Obtenha o nome atual do ramo git
git branch --show-current
Average Ant
git branch --show-current
git rev-parse --abbrev-ref HEAD
#!/bin/bash
echo $(git symbolic-ref --short HEAD)
#!/bin/bash
branch=$(git symbolic-ref --short HEAD)
echo
echo "**** Running post-commit hook from branch $branch"
echo