Nowadays there's the `--show-current` option:
git branch --show-current
See https://git-scm.com/docs/git-branch git branch --show-current
See https://git-scm.com/docs/git-branchNo comments yet.