Gitignore Generator
Gitignore Generator — runs in your browser. Inputs are not stored.
.gitignore generator
Choose a stack
How to use
- Check environments under stack. Defaults are Node.js, macOS, and .env / secrets.
- You can add Python, Java / Maven / Gradle, Go, Rust, PHP / Composer, Windows, VS Code, and JetBrains.
- Press Generate to concatenate .gitignore text below. Change checks, then generate again.
- Copy into the project-root .gitignore and delete lines you do not need.
- Reset restores Node, macOS, and .env as the default checks.
Key concepts
The .gitignore generator is a starting template of paths Git should not track, grouped by stack. Node adds node_modules, dist, .next; Python adds __pycache__, venv; Java adds target, .gradle. You can also add macOS .DS_Store, Windows Thumbs.db, and editor .vscode / .idea. The goal is a first .gitignore so node_modules and venv are not committed, and OS junk plus secret-key patterns are stripped before a team repo. The result is only a starting point.
Secrets blocks .env, *.pem, and *.key while leaving .env.example as an exception. It is a summary, not identical to GitHub’s official gitignore repo—edit monorepos and build artifacts to fit the project. Combining happens only in the browser and is not uploaded. It concatenates blocks and does not know project-specific build folders. Always edit after generate. For a monorepo, add paths such as packages/*/dist after copy, and merging language official templates is safer.
Example
Generate with the default checks (Node.js, macOS, .env) and node_modules/, .DS_Store, and .env blocks concatenate in one file. Add Python and VS Code, generate again, and __pycache__/ and .vscode/ are added. After copy, add a log folder or local config line if needed. Node+Python+macOS stacks node_modules, __pycache__, and .DS_Store. .env.example stays excepted in the secrets block. Java and JetBrains add target/ and .idea/. Windows adds Thumbs.db.
Related: robots.txt generator
Frequently asked questions
Does the gitignore generator match GitHub official templates?
It is a summary of common items and can differ from official templates. It is shorter than GitHub gitignore templates—merging language official templates is safer. Edit on that assumption.
How do I add custom ignore rules?
Edit the text after generate. The on-screen result is read-only, so copy it and add rules in an editor.
Does gitignore block .env secret keys?
The .env / secrets option is on by default. Add extra paths yourself. pem and key patterns do not catch every secret—review paths.
Is .gitignore content uploaded to a server?
No. Combining happens only in the browser. Check combinations stay on this tab.
Does changing checks regenerate automatically?
Press Generate again to apply. Reset turns on only Node, macOS, and .env. If a Rust project should track Cargo.lock, delete that line.
Why does the Rust option ignore Cargo.lock?
The summary follows library convention. For a binary crate, delete that line. After reset, press Generate once to refresh the text. After changing checks, press Generate again.
Last reviewed: 2026-09-04