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