git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC] Delete current branch

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jul 19, 2013, 10:35 UTC
Message-ID
<CALkWK0=8q4J2yi2to_+41kJSA5E59CBwkG69Hj7MmTPgUnSh5Q@mail.gmail.com>
Hi,

Many of my ideas turn out to be really stupid, and I need to throw away my feature branch. So, I find myself doing this often:

  # on branch menuconfig-jk
  $ git checkout master
  $ git branch -D<BACKSAPCE>
  # er, what was the branch name again?
  $ git checkout -
  # Ah
  $ git checkout master
  $ git branch -D menuconfig-jk

So, I scripted it for myself. Perhaps we should get the functionality in core as `git branch -Dc` (c for "current"; or something)?

Also, perhaps a `git describe -` corresponding to `git checkout -`? Then I can use it with --contains --all to get the name of the previous branch.

Thanks.
Next: Andreas Schwab
Message 1 of 10 in “[RFC] Delete current branch”
  1. Ramkumar RamachandraJul 19, 2013
  2. Andreas SchwabJul 19, 2013
  3. Ramkumar RamachandraJul 19, 2013
  4. Junio C HamanoJul 19, 2013
  5. Ramkumar RamachandraJul 19, 2013
  6. Junio C HamanoJul 19, 2013
  7. Ramkumar RamachandraJul 19, 2013
  8. Taylor HedbergJul 19, 2013
  9. Junio C HamanoJul 19, 2013
  10. Junio C HamanoJul 19, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.