SyntaxFix
Write A Post
Hire A Developer
Questions
This is not shorter, but it deals with detached branches as well:
git branch | awk -v FS=' ' '/\*/{print $NF}' | sed 's|[()]||g'