1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00
Files
til/git/what-is-the-current-branch.md
2015-12-17 08:52:57 -06:00

312 B

What Is The Current Branch?

This question can be answered with one of git's plumbing commands, rev-parse.

$ git rev-parse --abbrev-ref HEAD

The --abbrev-ref flag tells git-rev-parse to give us the short name for HEAD instead of the SHA.

source