1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-05 16:18:01 +00:00

Add What Is The Current Branch as a git til.

This commit is contained in:
jbranchaud
2015-12-17 08:52:57 -06:00
parent 042930072c
commit e04553c8f4
2 changed files with 14 additions and 0 deletions

View File

@@ -84,6 +84,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
- [Stashing Untracked Files](git/stashing-untracked-files.md)
- [Untrack A File Without Deleting It](git/untrack-a-file-without-deleting-it.md)
- [Verbose Commit Message](git/verbose-commit-message.md)
- [What Is The Current Branch](git/what-is-the-current-branch.md)
- [Whitespace Warnings](git/whitespace-warnings.md)
### go

View File

@@ -0,0 +1,13 @@
# 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)