Tuesday, 27 September 2016

Git: Show current branch name only

While git branch will show you all branches and highlight the current one with an asterisk, it can be too cumbersome when working with lots of branches.
To show only the branch you are currently on, use:

git rev-parse --abbrev-ref HEAD

No comments:

Post a Comment