.gitignore Generator
Pick the languages, frameworks, editors and operating systems your project uses and get one clean, deduplicated .gitignore.
What This Generator Does
Almost every repository needs a .gitignore: without one, git add . happily commits node_modules/, compiled binaries, editor settings, .DS_Store files and — worst of all — .env files with passwords. A real project usually mixes several stacks (a Django backend, a Next.js frontend, Docker, a team on macOS and Windows), and copying several templates by hand leaves the same rule repeated three times. This tool combines the templates you select into one file and keeps each rule only once.
How to Use It
- Click the templates that match your project. Use the search box to filter — it also matches aliases, so "idea" finds JetBrains and "golang" finds Go.
- Add anything project-specific under Custom rules, one pattern per line.
- Check the merged file and the counter showing rules and duplicates removed.
- Click Download .gitignore (or Copy) and save it in the root of your repository.
Example: Python + Django
Selecting Python and then Django produces 32 rules with 5 duplicates removed. The Django section only adds what Python did not already cover:
### Django ### # Django *.log local_settings.py db.sqlite3 db.sqlite3-journal media/ staticfiles/
__pycache__/, *.py[cod], .venv/, venv/ and .env were already in the Python section, so they were dropped together with the headings that only contained them.
Pattern Syntax in 60 Seconds
| Pattern | Matches |
|---|---|
| *.log | Any file ending in .log, in any folder |
| build/ | Any directory named build, at any depth (not files named build) |
| /dist | dist only at the repository root |
| docs/*.pdf | PDFs directly inside docs/, not in its subfolders |
| **/temp | temp at any depth (same as temp without a slash) |
| !keep.log | Re-include keep.log after *.log ignored it |
| # text | A comment |
A negation cannot re-include a file if one of its parent directories is ignored — that is why the VS Code template uses .vscode/* (ignore the contents) rather than .vscode/ before un-ignoring settings.json.
Limitations
- The templates are condensed versions of the github/gitignore files: they cover the common cases, not every tool in each ecosystem.
- Deduplication compares exact text.
build/and/build/are different rules and both are kept. - Rule order matters for negations (
!). If you add a custom rule that should override a template, check that it appears after the rule it overrides. - It does not remove files Git already tracks — use
git rm --cachedfor those.
Tips
- Commit an
.env.examplewith dummy values so others know which variables exist; the Node template already re-includes it. - Commit lock files (
package-lock.json,poetry.lock,Cargo.lockfor applications) so builds are reproducible. - Run
git check-ignore -v path/to/fileto see which rule ignores a file. - Setting up a new repository? Add a LICENSE and a README too.
Frequently Asked Questions
What is a .gitignore file?
A text file in your repository that lists patterns Git should not track. Matching files do not show up in git status and are skipped by git add, which keeps build output, dependencies, logs and secrets out of the repository.
How does the generator remove duplicates?
Each rule is kept only the first time it appears. If Python and Django both list .env, it is written once under Python and dropped from Django. Comments are kept, and the status line shows how many duplicates were removed.
Which templates are available?
Node.js, Python, Java, Go, Rust, .NET/C#, PHP, Ruby, Swift/Xcode, Flutter/Dart, Next.js, Django, Laravel, Ruby on Rails, Android, Unity, Terraform, Docker, VS Code, JetBrains IDEs, Vim, macOS, Windows and Linux. They are condensed from the community github/gitignore collection.
I added a file to .gitignore but Git still tracks it. Why?
.gitignore only affects untracked files. Stop tracking the file with git rm --cached <file> (it stays on disk), commit, and from then on it will be ignored.
Should editor and OS files go in the project .gitignore?
Many teams prefer a global ignore file for personal files such as .DS_Store or .idea/, set with git config --global core.excludesFile. Adding them to the project file is also common and harmless.
Is anything sent to a server?
No. The templates are part of the page and the merge happens in your browser. Your custom rules are never uploaded.
Related tools
- Signature GeneratorCreate a handwritten-style signature by drawing or typing your name. Pick pen color and style, then download a transparent PNG or SVG.
- Chart MakerMake bar, line, pie and doughnut charts from pasted data or CSV. Customize colors, titles and labels, then download a high-resolution PNG.
- Favicon GeneratorGenerate favicons in multiple sizes (16×16, 32×32, 48×48, 64×64, 128×128) from any uploaded image. Download all sizes as individual PNGs.
- README GeneratorGenerate a professional GitHub README.md with sections for description, badges, installation, usage, and contributing. Copy or download as .md.
- License GeneratorGenerate open source license files: MIT, Apache 2.0, GPL 3.0, ISC, BSD 2-Clause, BSD 3-Clause, Unlicense. Copy or download as LICENSE.
- SVG Placeholder GeneratorGenerate SVG placeholder images with custom size, background color, text color, and label. Copy as SVG code or data URL.
All Generators tools · Found a bug or a wrong result? Report it.