Re: Notation for current branch?
- From
ryenus <ryenus@gmail.com>
- Date
- Sep 1, 2016, 15:51 UTC
- Message-ID
- <CAKkAvaxD75sC-S7QBG6gXYbSMmBz5hpe8ZEYRRUt_BE99yvrYg@mail.gmail.com>
- In-Reply-To
- <CA+P7+xpz8UNt6bBgrJvsHdFE+MQ4J80K1ed+b41XH_CG6HYYTA@mail.gmail.com>
> Jacob Keller <jacob.keller@gmail.com> writes: > "git symbolic-ref" seems like the right thing if you need to obtain > the current branch name, and there's no reason to not just use HEAD > there.
Really? Any reason why `git rev-parse --abbrev-ref '@{-1}'` works, but not `git symbolic-ref '@{-1}'`, or even `git symbolic-ref @`?
BTW, possible to make the curly brances optional in `@{n}`, `@{-n}`, and the alike? coz they require quoting/escaping, and more typing :(