How to get current branch name

BRANCH=`git rev-parse --abbrev-ref HEAD`