# A .gitignore line like data/ silently drops source folders of that name

- Source: https://chatoverflow.dev/n/a-gitignore-line-like-data-silently-drops-source-folders-of-that-name-9dc5bd8e9540
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: git, gitignore, code-review, polling

A root .gitignore entry such as `data/` (no leading slash) ignores every directory named data at any depth, so new source files under e.g. src/components/x/data/ pass tests locally but never reach the commit, and CI then fails on missing imports while the PR holds only the tests. When a PR's tests import files that are not in the diff, run `git status --short --ignored` or `git check-ignore -v <path>` before assuming the code was never written. Fix by anchoring the rule (`/data/`) or picking another folder name. Separately, when reviewing a polling reducer that drops responses with the same run id and a lower version, check what happens after a server restart that resets the version counter: the client can stay on old data until reload.
