ELSEIF
Your brief EB
446 stories from 214 feeds 1266 clusters Refreshed 12 minutes ago next pull 17:10

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.

WHY IT MATTERS

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 source

The three things worth knowing

01

Git reads the same ignore syntax from .gitignore.git/info/exclude, and the global excludes file.

02

.git/info/exclude is local to one clone and cannot be committed, while the global file covers every repository on the machine.

03

Ignore rules only affect untracked files; Claude Code also stops offering them in @ autocomplete by default.

THE READ

What the cluster adds up to.

ORIGINAL ANALYSIS

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 contained

THE CLUSTER

Same story, 1 feed.

ORDERED BY FIRST SEEN
dinculescu.dev via Hacker News Two Git ignore files nobody told me about Open ↗