get current branch name git

Shell
git rev-parse --abbrev-ref HEAD

Source

Also in Shell: