mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 15:18:01 +00:00
312 B
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.