Build a .gitignore from templates that carry what each ecosystem really produces, with each pattern kept once and duplicates across templates reported.
4 templates · 22 patterns
Every pattern is unique across the templates you chose.
# Node.js — Dependencies, logs and the caches every package manager writes.
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
*.tsbuildinfo
.npm/
.yarn/cache/
.yarn/install-state.gz
coverage/
.nyc_output/
# macOS — Finder and Spotlight droppings. Worth putting in a global ignore file instead.
.DS_Store
.AppleDouble
.LSOverride
._*
.Spotlight-V100
.Trashes
# VS Code — Keep settings.json and extensions.json tracked — they are team configuration.
.vscode/*
!.vscode/settings.json
!.vscode/extensions.json
!.vscode/tasks.json
!.vscode/launch.json
A .gitignore has no effect on a file git is already tracking. If something is committed already, adding a pattern does nothing until you run git rm --cached on it — which is the reason an ignored file keeps turning up in diffs. And a secret that has been committed stays in the history even after that, so it needs rotating rather than deleting.
Gitignore Generator runs entirely on your device — nothing is uploaded.
You’re on the Free plan. Compare plans
The usual generated .gitignore runs to several hundred lines assembled from every tool that has ever existed, which buries the ten patterns that matter under ignores for languages the project does not contain. Nobody reads it, nobody removes anything from it, and it grows.
These templates are deliberately short. Each carries what that ecosystem really produces and a note saying what the non-obvious entries are for — because a pattern nobody can explain is a pattern nobody will ever delete, and a file full of them stops being something people maintain.
The merge keeps each pattern once and reports what it de-duplicated, so the result is checkable rather than merely shorter. Order is preserved deliberately: gitignore is order-sensitive, the last matching pattern wins, and sorting across a negation changes what the file does. Sorting, when switched on, happens within a section and never moves a negation.
A .gitignore has no effect on a file git is already tracking, which is the single most common reason a correct pattern appears not to work. The file has to be removed from the index with `git rm --cached` first.
Because git is already tracking it. A .gitignore only affects untracked files — anything in the index stays there regardless. `git rm --cached <file>` removes it from tracking while leaving it on disk, and then the pattern takes effect.
No. If a secret has been committed it is in the history, and ignoring the file now changes nothing about that. The secret needs rotating; rewriting the history is a separate and much more disruptive job that does not undo the exposure.
Because length is a cost. A file carrying patterns for tools you do not use is a file nobody reads, and a pattern nobody can explain never gets removed. These carry what each ecosystem really writes, with a note saying why.
Yes, and patterns in it are relative to that directory. It is the cleaner way to ignore something that only applies to one part of a repository, rather than writing a deep path in the root file.
Because gitignore is order-sensitive — the last matching pattern wins. Sorting across a negation can change what the file does, so sorting is applied only within a section and never reorders a negation.