git branch --show-current
//all branch and current branch
git branch
//current branch
git branch --show-current
git branch #starred one is your current branch
git rev-parse --abbrev-ref HEAD
// Check current branch
git branch --show-current
git checkout -b <branch-name>
##Current branch
echo $(git branch --show-current 2> /dev/null)
checking current branch