Gitignore Generator

Generate a .gitignore file from Node, Python, React, Java, macOS, VSCode and more presets. 100% browser-based, copy or download instantly.

How to use

  1. Select stacks — Tick the languages, OSes, and editors used in your repo.
  2. Preview the file — Combined .gitignore updates in real time as you toggle presets.
  3. Copy or download — Drop the file into your project root and commit it on day one.

What a Good .gitignore Looks Like

A solid .gitignore reflects the entire toolchain — language artefacts (node_modules, __pycache__, target), build outputs (dist, build, out), test caches (coverage, .pytest_cache), editor scratch files (.vscode, .idea), and OS junk (.DS_Store, Thumbs.db). Skipping any one of these eventually causes a noisy diff or a leaked secret.

Why Generate It Instead of Copy-Paste

Manually maintaining .gitignore is error-prone. Patterns drift between repos, OS-specific entries get forgotten, and copy-pasted snippets from Stack Overflow often include outdated globs. Generating from curated presets ensures every repo starts from the same baseline.

Order Matters Less Than You Think

Git evaluates patterns top-to-bottom, but for ignore rules (without negation) order is irrelevant — a path matched by any line is ignored. Where order matters is with negation rules (!path); the un-ignore must come after the ignore. The VSCode preset uses this for .vscode/settings.json.

Global vs Repo-Level

OS and editor patterns (.DS_Store, .idea/) belong in a global gitignore at ~/.gitignore_global, not in every repo. Configure it once: git config --global core.excludesfile ~/.gitignore_global. The repo-level file should focus on project-specific patterns. Many teams duplicate them in both places for safety — that's fine.

After You Commit .gitignore

New patterns only ignore untracked files. If a file is already tracked, .gitignore won't untrack it — run git rm --cached path/to/file first, then commit the .gitignore and the removal together.

Frequently asked questions

Why do I need a .gitignore file?

It prevents build artefacts, dependencies, secrets, and OS clutter from being committed to git. A missing or weak .gitignore is the #1 reason API keys, node_modules folders, and IDE configs leak into public repositories.

Should I add .env to .gitignore?

Yes — always. Environment files contain secrets like database URLs and API tokens. The Node and React presets here include .env, .env.local, and .env.*.local by default. Commit only a .env.example template with placeholder values.

Can I combine multiple language presets?

Yes. Many real-world projects mix stacks — a Python backend with a React frontend, or a Java service with Node-based tooling. Just tick every relevant preset; the generator concatenates them with section headers so the result stays readable.

Is this the same as GitHub's gitignore.io?

Conceptually yes — it's a curated list of common patterns. This page runs entirely in your browser with no server calls, so you can generate a .gitignore even on an air-gapped laptop. For exotic stacks, supplement with GitHub's official github/gitignore repo.

What if I commit a secret by mistake?

Rotate the secret immediately — assume it's compromised. Then use git filter-repo or BFG Repo-Cleaner to scrub the file from history, force-push, and ask collaborators to re-clone. Add the file pattern to .gitignore so it never happens again.

Related free tools

  • XML Formatter & Minifier — Beautify or minify any XML — SOAP, RSS, SVG, sitemap. Browser-based parser.
  • XML to JSON Converter — Parse any well-formed XML into a clean JSON tree with attributes and arrays.
  • JSON to XML Converter — Convert JSON to well-formed XML — supports attributes, custom root, declaration.
  • CSV Viewer — Open CSV or TSV files in your browser — sort, search, paginate, export filtered view.
  • JSON to CSV Converter — Convert JSON data to CSV format. Export to spreadsheets easily.
  • CSV to JSON Converter — Convert CSV data to JSON format. Useful for API development.
  • JSON Formatter — Format, beautify, or minify JSON with customizable indentation.
  • JSON Validator — Validate JSON syntax and find errors with line and column numbers.
  • HTML Minifier — Compress HTML by removing comments, whitespace, and line breaks.
  • CSS Minifier — Minify CSS by stripping comments, whitespace, and unnecessary characters.
  • JavaScript Minifier — Compress JavaScript by removing comments, whitespace, and empty lines.
  • Base64 Encoder/Decoder — Encode text to Base64 or decode Base64 back to text. UTF-8 support.

Browse all free tools · Guides and tutorials · PDF tools · Developer tools · Text tools · SEO tools