Composed in the browser

.gitignore generator

Compose a .gitignore from the stacks you actually use — grouped, de-duplicated, and with the .env example kept.

The file is composed in this tab. Nothing about your project is sent anywhere.

Language
Tooling
Secrets
Editor
Operating system

Short answer: tick your stack and copy the file. Node, Python, Java, Go, Rust, .NET, Flutter, Terraform, editors and OS files each contribute one grouped block, and duplicates are collapsed so the result stays readable.

What a good .gitignore actually prevents

Build output, dependency folders, editor state and — the one that matters — secret files. The .env block here keeps .env.example tracked while ignoring everything else, which is the arrangement that lets a new contributor start without a password ever entering the repository.

Order and negation

Git applies the last matching rule, so a negation has to come after the ignore it carves an exception from. That is why the blocks are generated in a fixed order and why the extra box appends at the end rather than the top.

.gitignore questions

Why does the .env block keep .env.example?

Because the example file is the one that belongs in the repository: it documents which variables exist without carrying a secret. The negation line `!.env.example` re-includes it after `.env.*` is ignored, and the order matters — a later rule wins.

Is a .gitignore enough to protect secrets?

No. It stops an accidental commit, not a determined one, and it does nothing for a secret that was already committed — that needs history rewriting and key rotation. Treat this file as the seatbelt, not the brakes.

What if my project needs a path that is not listed?

Add it in the extra box; duplicates are dropped, so adding `dist/` when Node is already selected does not repeat it. Project-specific entries land in their own section at the end, which keeps the generated part reviewable.

Should I ignore lockfiles?

No, and this generator does not. Lockfiles belong in the repository — they are what makes a build reproducible. The one exception in the list is Cargo.lock for libraries, which is the Rust convention.

Related tools