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

14 lines
312 B
Markdown

# 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](http://stackoverflow.com/a/12142066/535590)