.gitignore Generator
Build a .gitignore from 45+ language, framework, editor and OS templates, with duplicate rules merged automatically.
All 45 templates
More options & your own rules
Your .gitignore no templates selected yet
# Tick one or more templates above and your .gitignore is built here instantly.
How it works
Tick the languages, frameworks, editors and operating systems your repository uses and the
matching ignore rules are stitched together as you go. Every template is a curated set of
patterns in the syntax documented by gitignore(5), the Git manual page for the
format: one pattern per line, # starts a comment, a trailing /
matches directories only, a leading / anchors the pattern to the folder holding
the .gitignore, * matches anything except /,
** crosses directory boundaries, and a leading ! re-includes a file
an earlier rule excluded. Templates are always written in the same fixed order, so
regenerating after adding one more framework produces a clean, reviewable diff.
Because stacks overlap (Node and Next.js both ignore node_modules/, most Python
tooling ignores __pycache__/), duplicate patterns are collapsed to their first
occurrence by default and the counter tells you how many were removed. Turn off section
comments for a bare list of patterns. Anything you type in the extra rules box is appended in
its own section, and a warning appears if a rule uses backslashes, because Git patterns always
use forward slashes even on Windows.
Remember that .gitignore only affects untracked files. If a file is already
tracked, adding it here changes nothing until you run
git rm --cached <file>. The whole generator is a lookup table plus string
joining running in your browser, so no repository is read and nothing you type is uploaded.
Frequently asked questions
How do I create a .gitignore file?
Tick the templates that match your stack, for example Node plus Next.js plus macOS plus JetBrains IDEs, and the combined file is written below as you pick. Add any rules of your own in the extra rules box, then use Copy .gitignore or Download .gitignore and save it as a file named .gitignore in the root of your repository. Nothing is sent to a server: the file is assembled in your browser.
What should I put in my .gitignore?
Anything Git should not track: dependency folders such as node_modules/ or vendor/, build output such as dist/, target/ or build/, environment files such as .env, editor and IDE folders such as .idea/ and .vscode/, and OS junk such as .DS_Store or Thumbs.db. This generator covers all four groups, and because stacks overlap it collapses repeated patterns to their first occurrence and tells you how many duplicates it merged.
Why is my file still tracked after I added it to .gitignore?
A .gitignore only affects untracked files. If Git already tracks the file, the rule is ignored until you remove it from the index with git rm --cached <file> (add -r for a folder) and commit that change. The file stays on disk and, from then on, the pattern in your .gitignore keeps it out of the repository.