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

Re: Cannot delete weirdly named branch

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 30, 2012, 17:55 UTC
Message-ID
<7vk3xlqgl3.fsf@alter.siamese.dyndns.org>
In-Reply-To
<5016C2C9.5050904@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 14 quoted lines
> On 07/23/2012 08:42 PM, Junio C Hamano wrote:
>> "abhisekpan@gmail.com" <abhisekpan@gmail.com> writes:
>>
>>> Now I cannot delete this branch. Running:
>>> git branch -d --tracking
>>> gives an error: unknown option `tracking'
>>
>> I do not think this is supposed to work, but it does by accident.
>>
>>      $ git branch -d -- --tracking
>>      Deleted branch --tracking (was 8670e20).
>
> The plumbing command "git update-ref -d refs/heads/--tracking" can
> also be used to delete such a branch.

Note that once you started using the plumbing you are assumed to know what you are doing. "update-ref -d" does not offer the "you will be losing these commits" safety, and it will not remove configuration items for "branch.--tracking.*" keys. You would want to remove them yourself if you want to emulate "git branch -d".

Previous: Michael Haggerty
Message 4 of 4 in “Cannot delete weirdly named branch”
  1. abhisekpan@gmail.comJul 23, 2012
  2. Junio C HamanoJul 23, 2012
  3. Michael HaggertyJul 30, 2012
  4. Junio C HamanoJul 30, 2012

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.