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

gitignore pattern matching issue with Windows

From
TGTDD Guru <tddguru@gmail.com>
Date
Jul 28, 2025, 21:09 UTC
Message-ID
<CAK2EJNO-FY+TzAnwtOhAgbWpnBP1d8yfjPidWSd=rVKM6rrdhQ@mail.gmail.com>
  Git does not seem to properly handle the pattern [AB] but it does handle [ab].
Here is the demonstration of the bug:

C:\gitbug>git --version git version 2.50.1.windows.1

C:\gitbug>echo [ab] > .gitignore

C:\gitbug>type .gitignore [ab]

C:\gitbug>git check-ignore -v a .gitignore:1:[ab] a

C:\gitbug>git check-ignore -v b .gitignore:1:[ab] b

C:\gitbug>git check-ignore -v A .gitignore:1:[ab] A

C:\gitbug>git check-ignore -v B .gitignore:1:[ab] B

C:\gitbug>echo [AB] > .gitignore

C:\gitbug>type .gitignore [AB]

C:\gitbug>git check-ignore -v a
C:\gitbug>git check-ignore -v b
C:\gitbug>git check-ignore -v A
C:\gitbug>git check-ignore -v B

C:\gitbug>git config core.ignorecase true

C:\gitbug>ver
Microsoft Windows [Version 10.0.19045.6093]
C:\gitbug>
Rex McCarthy
Next: Junio C Hamano
Message 1 of 2 in “gitignore pattern matching issue with Windows”
  1. TDD GuruJul 28, 2025
  2. Junio C HamanoJul 28, 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.