Git's lesser-known ignore files: .git/info/exclude and global excludes
A developer describes discovering that git supports two additional ignore mechanisms beyond the well-known .gitignore file: a per-clone .git/info/exclude file and a global excludes file set via the core.excludesFile config option. Neither of these files gets committed to the repository, unlike .gitignore, making them suited for personal scratch files and editor or OS clutter respectively. The writer says an AI coding assistant, Claude, prompted the discovery by suggesting untracked personal notes be added to .git/info/exclude.
GoKawiil's interpretation of the reporting above, not reported fact.
The piece highlights a common gap in developer knowledge about a decade-old git feature, suggesting many practitioners default to workarounds—like leaving files untracked—when native tooling already solves the problem. It also illustrates, anecdotally, how AI coding assistants can surface underused tool features that experienced developers may have missed, which could hint at a broader role for such assistants in tooling education rather than just code generation.
- Git supports three levels of ignore files: .gitignore (committed, shared), .git/info/exclude (local to one clone, never committed), and a global excludes file (applies across all repos on a machine).
- The .git/info/exclude file is useful for personal scratch files, like AI agent plans or private notes, that shouldn't be pushed to a shared repository.
- The discovery was prompted by a suggestion from the AI assistant Claude, illustrating how such tools can reveal lesser-known features of everyday developer tools.
Source: mihai.dinculescu.dev, 2026-09-23
Published there as: “Two Git ignore files nobody told me about”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.