gitbranch

It simply shows current branch name - or nothing if it isn’t a git repo.

Build and install

sh cargo install gitbranch

Use

sh gitbranch <directory>