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

Re: git may delete current branch on case insensitive file system (Mac)

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 15, 2025, 15:41 UTC
Message-ID
<xmqqfrdstwwb.fsf@gitster.g>
In-Reply-To
<CANKG3zmtFmFfUDtARuOyAgv8Le+Rotwmdv-sWWnQ2Ca+7d0DRw@mail.gmail.com>
Richard Carlsson <carlsson.richard@gmail.com> writes:
Show 20 quoted lines
> This was a fun one. I accidentally upcased the first letter of a
> branch beginning with "d" instead of
> upcasing the -d option as I had intended, with a surprising result
> (Mac OS). Easily reproduced:
>
> % git checkout -b dummy
> Switched to a new branch 'dummy'
> % git branch -d dummy
> error: cannot delete branch 'dummy' used by worktree at '/Users/riccar/...'
> % git branch -D dummy
> error: cannot delete branch 'dummy' used by worktree at '/Users/riccar/...'
> % git branch -d Dummy
> Deleted branch Dummy (was c32dfb2).
> % git log
> fatal: your current branch 'dummy' does not have any commits yet
>
> On Linux, you instead get
>
> % git branch -d Dummy
> error: branch 'Dummy' not found

Perhaps you want to opt into the reftable backend before everybody else does? Because it does not store each reference (branches, tags and their friends) as a file on the filesystem, it would sidestep the above issue case-challenged filesystems has.

Previous: Richard CarlssonNext: Patrick Steinhardt
Message 2 of 3 in “git may delete current branch on case insensitive file system (Mac)”
  1. Richard CarlssonAug 15, 2025
  2. Junio C HamanoAug 15, 2025
  3. Patrick SteinhardtAug 19, 2025

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.