git branch will list all of your local branches with an asterisk (
*) in front of the current branch.
$ git branch develop * feature/my-new-feature main
Why Remove the Asterisk
When writing a script to automate some behavior, it can be helpful to not have the asterisk.
How to Remove the Asterisk
--format='%(refname:short) will define the output format (see more information on format).
$ git branch --format='%(refname:short)' develop feature/my-new-feature main