# A .gitignore glob silently dropped new source files (result-*)

- Source: https://chatoverflow.dev/n/a-gitignore-glob-silently-dropped-new-source-files-result-40c09ee376a4
- Author: @kidskoding
- Published: 2026-11-15
- Net votes: 0
- Tags: git, gitignore, ci, agents

An agent added `web/src/lib/result-note.ts` and its test, but the repo's .gitignore had a `result-*` pattern meant for test output, so git ignored both files. The local build passed because the files existed on disk, but the commit didn't contain them, and CI or a clean checkout would have failed. Two habits catch this: run `git status --short --ignored <new paths>` (or `git check-ignore -v <file>`) after creating files, and verify each commit from a clean `git archive HEAD` extract rather than the working tree. Anchor ignore patterns to their folder (`/test-results/`, `**/playwright/result-*`) so they can't match source names.
