What it does
Select every language, framework, editor and operating system that applies to your project, and the tool combines the matching patterns into one file, each under a labelled section.
How to use
- Select templates from the list, or filter by name first.
- Review the result, since some frameworks share overlapping patterns.
- Copy it or download it directly as
.gitignore.
Good to know
These templates cover the common cases for each entry, similar in spirit to GitHub's own gitignore templates, but are not a byte-for-byte copy of any single source. Review the file for anything specific to your project (build output folders, local config, secrets) that these general templates would not know about.
Example
A Node project edited on a Mac would select Node and macOS. The result has a ### Node ### section with node_modules/, log files, dist/ and .env files, followed by a ### macOS ### section with .DS_Store. macOS, Windows and Linux start selected; use the chips under "Selected" to remove one, or "Clear selection" to start over.
Things to check
- Secrets. Only some templates (Node, React, Next.js, Laravel) list
.envfiles. If your stack keeps secrets elsewhere, add that file yourself. To read or convert an existing .env file, use the .env ⇄ JSON Converter. - Lock files. The Rust template ignores
Cargo.lockand the Dart template ignorespubspec.lock, which suits libraries. Applications usually commit them, so delete those lines for an app. The Dart template also ignores generated*.g.dartfiles; remove that line if you commit generated code. - Wrapper files. The Java template ignores
*.jarbut keepsgradle/wrapper/gradle-wrapper.jarand.mvn/wrapper/maven-wrapper.jarso the build wrappers still work. - Order matters. A line starting with
!re-includes a file only if it comes after the pattern that ignored it, so do not sort or reorder the lines. - Already tracked files. A .gitignore does not affect files Git already tracks. Remove them from the index with
git rm --cached pathand commit.
If you already have a .gitignore, paste both versions into the Text Diff Checker to see what the generated file would add.
Example: Node and Python together
macOS, Windows and Linux are selected by default, because their operating-system files (such as .DS_Store and Thumbs.db) should never be committed. Adding Node and Python produces a file with a labelled section for each template, for example:
### Node ###
node_modules/
npm-debug.log*
dist/
build/
coverage/
.env
.env.local
### Python ###
__pycache__/
*.py[cod]
.venv/
.pytest_cache/Notice that .env is ignored. Files with passwords and API keys should stay out of the repository. If one was ever committed, rotating the secret matters more than deleting the file; you can check text for leaked secrets with the Secret Scanner.
Using the file
- Save the result as
.gitignorein the root of your repository, then commit it. - A .gitignore does not affect files that Git already tracks. To stop tracking one, run
git rm --cachedon it, then commit. - For operating-system and editor files that you never want in any project, a global ignore file is cleaner: set it with
git config --global core.excludesfile.
Frequently asked questions
How many templates are there?
27, covering languages, operating systems, editors and frameworks. Use the search box to filter them.
Can I edit the result?
Yes. You can copy or download the text and add your own lines, such as the names of local build folders.
Is anything sent to a server?
No. The templates are part of the page and the file is assembled in your browser.
Privacy
This tool runs entirely in your browser. What you enter is processed on your device and is not sent to a server.