Re: [RFC] Delete current branch

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [RFC] Delete current branch

From: Andreas Schwab <hidden>
Date: 2016-06-15 22:58:13

Ramkumar Ramachandra [off-list ref] writes:
  # er, what was the branch name again?
  $ git checkout -
You could take a look in the reflog.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Re: [RFC] Delete current branch

From: Ramkumar Ramachandra <hidden>
Date: 2016-06-15 22:58:13

Andreas Schwab wrote:
Ramkumar Ramachandra [off-list ref] writes:
quoted
  # er, what was the branch name again?
  $ git checkout -
You could take a look in the reflog.
Yeah, or use the @{-N} revision to do that for me.  My scripted
version is essentially:

  test "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" || exit 1
  git checkout master
  git branch -D @{-1}

The main problem is the hard-coding of "master": I suppose I could
replace that with @{-1} too.

Not a big deal: I was just wondering if others use it often enough for
it to become `branch -Dc` in core; @{-N} is quite obscure.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help