Hello,
I found an unexplainable behavior - see below.
best regards, Alf
Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.
What did you do before the bug happened? (Steps to reproduce your issue) Adding an new line to .gitignore to filter directories.
What did you expect to happen? (Expected behavior) I expected to see no backup_STOCKS* directory on git status.
What happened instead? (Actual behavior) It also surpressed the backup/ directory.
What's different between what you expected and what actually happened? When I surpress backup_STOCKS* or backup_STOCKS*/ I expect a backup/ directory still to be visible.
Anything else you want to add: Here are the actions:
$ git status On branch master Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: .gitignoreUntracked files:
(use "git add <file>..." to include in what will be committed)
asset_history_2025_20260114.csv
backup_STOCKS_20260107_060326/
backup_STOCKS_20260107_184151/
backup_STOCKS_20260110_173702/
backup_STOCKS_20260114_172546/
backup_STOCKS_20260116_201409/
backup_STOCKS_20260116_210037/
backup_STOCKS_20260117_184437/
backup_STOCKS_20260119_202817/
backups/
index.after.txt
index.before.txtno changes added to commit (use "git add" and/or "git commit -a") $ echo 'backup_STOCKS*/' >>.gitignore $ git status On branch master Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: .gitignoreUntracked files:
(use "git add <file>..." to include in what will be committed)
asset_history_2025_20260114.csv
index.after.txt
index.before.txt
$ cat .gitignore
png/
__pycache__
mongodb.yaml
*.log
*.pdf
OLD
.vscode
ca.pem
py.pem
states/
.skylos
backup_STOCKS*/[System Info] git version: git version 2.43.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 compiler info: gnuc: 13.3 libc info: glibc: 2.39 $SHELL (typically, interactive shell): /bin/bash
[Enabled Hooks]