The templates ship with this page: selection and merging happen in your browser, with no upload and no network. Each template keeps only the rules that actually bite; files that must be committed (go.sum, Cargo.lock, composer.lock, gradle-wrapper.jar) are never ignored.
Syntax cheat sheet
The pattern language is small, but anchoring and negation are the two rules people get wrong most often. git never complains about a bad pattern; it just quietly ignores something you wanted to keep.
| Pattern | Meaning |
|---|
Four traps worth knowing
Online .gitignore Generator
The first thing a new repository needs is a .gitignore, and the usual move is to search for "python gitignore" and paste the entire official template - a hundred-odd lines of which half is irrelevant, while the rules that actually matter (.env, editor folders) get left out until some commit pushes a secret upstream.
This page splits 40 common stacks into individually tickable blocks. Select and they merge: duplicate rules collapse to one occurrence, ordering is preserved, and negation rules written in the wrong place are called out immediately. Every template ships with the page, so the merging happens in your browser with no upload and no network.
Features
- 40 stack templates — Fifteen languages, six frameworks, five editors, three operating systems, seven build tools and four common blocks, all searchable.
- Cross-template de-duplication — When the same rule appears in several templates it is kept at its first position, so ticking two more boxes does not double the file.
- Dead negation detection — A !keep.log rule placed before the ignore rule it depends on, or under a directory that is ignored as a whole, does nothing at all. The output lists every such rule below the result.
- Append your own lines — Add rules at the top or the bottom. At the top means your wording wins: generated lines that duplicate it are dropped.
- Copy and download — Copy to clipboard, or download as gitignore.txt (browsers will not save a file whose name starts with a dot - rename it).
- Local only — There is no upload endpoint on this page, it works offline, and closing the tab leaves nothing behind.
How to use
- Type a keyword in the search box (python, docker, unity), or click one of the common sets.
- Tick whatever applies - languages, frameworks, editors and OSes mix freely, and the output updates live.
- Read the warning under the result: if a negation rule cannot take effect, it tells you which one.
- Copy it into the .gitignore at the repository root, or download and rename.
FAQ
I already committed files. Does adding a .gitignore help?
No. A .gitignore only affects untracked files; anything git already tracks stays tracked. To untrack a file while keeping it on disk, run git rm --cached <file> and commit that removal.
Why not ship the full official templates?
The official ones aim for complete coverage, often running to a hundred lines and including tools nobody has used in a decade. For a real project that is mostly noise, and the longer the file the less anyone reads it - the few rules that matter get buried. Each template here keeps only the rules that actually bite.
Why is the downloaded file called gitignore.txt?
Neither browsers nor operating systems let a web page save a file whose name starts with a dot. Rename it to .gitignore after downloading, or just copy and paste into the project.
Why does my !important.log rule do nothing?
Negation is strictly ordered: !xxx must come after the rule that ignores xxx. On top of that, if a parent directory is ignored as a whole (for example logs/), git never descends into it, so no negation inside can help - switch to logs/* and re-include individual entries. The warning below the output catches both cases.
Is there a difference between node_modules and node_modules/?
The trailing slash matches directories only, never a regular file of the same name. In practice the difference is tiny, but if the repository happens to contain a script called node_modules, the slash form is safer.
Do I need a .gitignore in every subdirectory?
Usually not. One at the repository root covers the project, with paths resolved relative to it. Splitting is only worth it when subdirectories need genuinely different rule sets, such as a monorepo whose packages diverge a lot.