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

`git add` with unmatching case silently fails on case-insensitive file systems

From
Lê Duy Quang <leduyquang753@gmail.com>
Date
Jan 21, 2025, 07:52 UTC
Message-ID
<7e5e2f26-deda-41a3-af46-79c42435b3c7@gmail.com>
Good morning,

I am using Git on Windows, whose file system is case-insensitive. If the working tree has a file called `SourceFile.c`, for example, and I run `git add sourcefile.c`, I would expect either (a) Git stages `SourceFile.c` or (b) Git errors with "fatal: pathspec 'sourcefile.c' did not match any files". However, none of those actually took place; instead Git did not stage the file and produced no output as if the command had succeeded, which led me to proceed to committing without realizing I had missed the file.

I would like to know whether this is intended behavior or I have bumped into a case-sensitivity bug.

Regards, Quang

Next: Torsten Bögershausen
Message 1 of 2 in “`git add` with unmatching case silently fails on case-insensitive file systems”
  1. Lê Duy QuangJan 21, 2025
  2. Torsten BögershausenJan 21, 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.