DEV TOOLS Signal 449
Git supports per-repository and global ignore files beyond committed .gitignore rules
Illustration only Photo by Anastasiya D on Unsplash
Git can ignore untracked files through a per-repository .git/info/exclude or a machine-wide core.excludesFile, in addition to committed .gitignore patterns.
The per-repository option keeps private scratch files out of shared history while clearing them from status. It does not affect files already tracked, and global rules apply across repositories on the machine.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
Git reads the same ignore syntax from .gitignore.git/info/exclude, and the global excludes file.
.git/info/exclude is local to one clone and cannot be committed, while the global file covers every repository on the machine.
Ignore rules only affect untracked files; Claude Code also stops offering them in @ autocomplete by default.
THE READ
What the cluster adds up to.
Git applies the same ignore syntax in three places: committed .gitignore files, the per-clone .git/info/exclude, and the machine-wide global excludes file configured by core.excludesFile. The per-clone file affects only that clone, whereas the global file covers every repository on the machine. These are plain text files, so patterns can be appended directly without a dedicated command.
For private notes, agent plans, or other local scratch data.git/info/exclude provides a clean working tree without adding those names to shared history. In a linked worktree.git is a file rather than a directory, so the common-directory form using git rev-parse --git-common-dir points at the exclude file shared by every worktree. A global default is ~/.config/git/ignore, with XDG_CONFIG_HOME/git/ignore used when that variable is set.
The main cost is configuration scope: a global rule affects every repository on the machine, while a per-repository rule must be maintained separately in each clone. Ignore rules never apply to files already tracked, so they cannot remove tracked content from status or history. With Claude Code, ignored files disappear from @ autocomplete by default, although the setting only controls autocomplete and the agent can still read the files. Disabling Respect .gitignore in file picker or setting respectGitignore to false restores autocomplete.
Written by elseif from the cluster below · checked for specifics the sources never containedTHE CLUSTER