.gitignore Generator

Pick the languages, frameworks, editors and operating systems your project uses and get one clean, deduplicated .gitignore.

Language
Framework
Platform & tools
Editor
Operating system
61 rules · 0 duplicates removed

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

  1. 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.
  2. Add anything project-specific under Custom rules, one pattern per line.
  3. Check the merged file and the counter showing rules and duplicates removed.
  4. 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

PatternMatches
*.logAny file ending in .log, in any folder
build/Any directory named build, at any depth (not files named build)
/distdist only at the repository root
docs/*.pdfPDFs directly inside docs/, not in its subfolders
**/temptemp at any depth (same as temp without a slash)
!keep.logRe-include keep.log after *.log ignored it
# textA 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 --cached for those.

Tips

  • Commit an .env.example with dummy values so others know which variables exist; the Node template already re-includes it.
  • Commit lock files (package-lock.json, poetry.lock, Cargo.lock for applications) so builds are reproducible.
  • Run git check-ignore -v path/to/file to 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.