Generate a .gitignore file from Node, Python, React, Java, macOS, VSCode and more presets. 100% browser-based, copy or download instantly.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Browse all free tools · Guides and tutorials · PDF tools · Developer tools · Text tools · SEO tools