Re: Git Feature Request - show current branch
- From
Michael J Gruber <git@drmicha.warpmail.net>
- Date
- Feb 19, 2015, 16:21 UTC
- Message-ID
- <54E60D71.6050906@drmicha.warpmail.net>
- In-Reply-To
- <001801d04c48$732f9980$598ecc80$@nexbridge.com>
Randall S. Becker venit, vidit, dixit 19.02.2015 14:32:
> git symbolic-ref --short HEAD
That errors out when HEAD is detached.
git rev-parse --symbolic-full-name [--abbrev-ref] HEAD
returns the branch name or HEAD. Though it's a bit difficult to discover.
I guess git 3.0 will have "git branch" and "git branches" :)
Michael