Obtenez le nom de branche actuel 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