Two Git ignore files nobody told me about
Developer blog explains .git/info/exclude and the global core.excludesFile as uncommitted alternatives to .gitignore for keeping personal scratch files untracked.
The post describes git's three ignore mechanisms: .gitignore (committed and shared), .git/info/exclude (per clone, never committed), and the global excludes file at ~/.config/git/ignore. It covers pattern syntax, a linked-worktree path caveat using git rev-parse --git-common-dir, and a Claude Code setting controlling whether ignored files appear in @ autocomplete.
- Organizations
- Git
- AI models
- Claude Code
From the original article
4 min read at mihai.dinculescu.devOne of my many bad habits is carrying untracked files around in the repositories I work on. I did learn, some time ago, that those files must never contain secrets, because sooner or later they get committed by mistake. I learned it the easy way, by watching a colleague learn it the hard way: furiously rewriting history to cover his tracks, then rotating cloud credentials in a panic.
By faithraven · mihai.dinculescu.dev
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.