git branch
should show all the local branches of your repo. The starred branch is your current branch.
To retrieve only the name of the branch you are on:
git rev-parse --abbrev-ref HEAD
or with Git 2.22 and above:
git branch --show-current
git branch
should show all the local branches of your repo. The starred branch is your current branch.
To retrieve only the name of the branch you are on:
git rev-parse --abbrev-ref HEAD
or with Git 2.22 and above:
git branch --show-current