Re: [RFC] Delete current branch
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Jul 19, 2013, 15:42 UTC
- Message-ID
- <CALkWK0m-q=Aoof62zhXnUYsJ7PQZwTLbQ50BUEmufVO4gtWNUA@mail.gmail.com>
- In-Reply-To
- <7vr4euy4c6.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 5 quoted lines
> Did you know that the general way to spell the branch previously you
> were on is "@{-1}" and "checkout -" is an ugly special case that is
> possible only because "checkout" does not happen to take a "-" as a
> valid argument that means something else (like the more usual "read
> from standard input")?I disagree that it is ugly: it's a very commonly used shortcut that I like. I love it so much that I have the following in my ~/.zshrc:
function - () {
if test "true" = "$(g rp --is-inside-work-tree 2>/dev/null)"; then
g co -
else
cd - >/dev/null
fi
}So, I just
$ -
to switch back and forth :)