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

.gitignore issue

From
ACAlf Clement <alf.clement@gmail.com>
Date
Jan 21, 2026, 18:32 UTC
Message-ID
<CAOQVjoi+Z7UgYP+CRVXFz-LWRcNOv571CNQTmLWBgB3ErhTRQA@mail.gmail.com>
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:   .gitignore
Untracked 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.txt

no 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:   .gitignore
Untracked 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]
Message 1 of 1 in “.gitignore issue”
  1. Alf ClementJan 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.