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

Re: .gitignore issue

From
Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Date
Jan 21, 2026, 18:51 UTC
Message-ID
<SL2P216MB1885CE309BDBA65860D8762FA296A@SL2P216MB1885.KORP216.PROD.OUTLOOK.COM>
Hi Alf,

This is expected behavior. When a directory matches an ignore rule, Git stops descending into it entirely. The pattern

        backup_STOCKS*/
matches directories starting with backup_STOCKS, and once Git prunes traversal at that level, similarly prefixed paths can disappear from git status, which is why backups/ no longer shows up.
This isn’t a bug, but a result of how ignore patterns and directory pruning work.
If you want to ignore only those directories and nothing else, anchoring the pattern helps:
        /backup_STOCKS_*/
You can also verify which rule is responsible with:
        git check-ignore -v backups/
Hope that clears it up.

Best, Pushkar

Next: Jeff King
Message 1 of 3 in “Re: .gitignore issue”
  1. Pushkar SinghJan 21, 2026
  2. Jeff KingJan 21, 2026
  3. Junio C HamanoJan 21, 2026

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.