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