Re: [RFC] Delete current branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andreas Schwab wrote:
> Ramkumar Ramachandra <artagnon@xxxxxxxxx> writes:
>
>>   # 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]