Skip to content

.gitignore GeneratorCreate a gitignore File Online

Pick your languages and frameworks — the combined .gitignore builds itself as you click. Or drop in an existing file to pre-select matches.

100% in-browser — all 312 official GitHub templates. Copy config link

Your .gitignore

No templates selected yet.

Pick the languages, frameworks, editors and operating systems your project uses — this free gitignore generator instantly builds a clean, combined .gitignore file from all 312 official GitHub templates. Copy or download in one click, or drop in an existing file to pre-select what already applies.

The fastest way to create a .gitignore file

Every Git repository accumulates files you never want to commit: compiled binaries, downloaded dependencies, editor scratch files, OS metadata, and — most dangerously — secrets like .env files. A well-built .gitignore keeps all of that out of version control automatically. This gitignore generator assembles one for you in seconds: select your languages and frameworks on the left, and a production-ready file appears on the right, ready to copy or download into your repo root.

The patterns come straight from github/gitignore, the public-domain collection GitHub itself offers when you create a new repository. Every single template in that repository — all 312 of them, across its root, Global/ and community/ folders — is vendored into this page, not a hand-picked subset. Your selections never leave the browser, there's no signup, and the popular set works instantly offline once loaded.

What is a .gitignore file and how does it work?

A .gitignore is a plain-text file placed in your repository. Each line is a pattern; any path matching a pattern is excluded from Git's tracking. Git evaluates these rules every time you run git status or git add, so ignored files simply never show up as changes. Key rules of the syntax:

Because the order of rules matters for negation, a good generator groups templates with clear headers and removes duplicate lines — exactly what this tool does.

Why combine multiple templates?

Real projects are rarely a single language. A typical full-stack app might use Node for tooling, Next.js for the frontend, Python for a data service, plus whatever editor and OS each teammate runs. If you only grab the Node template, you'll still accidentally commit __pycache__/, .idea/, or .DS_Store. Selecting every relevant template here merges them into one authoritative file so nothing slips through. The generator de-duplicates shared lines (like .env or dist/) so you don't get the same rule three times. Not every framework has its own upstream template — there's no separate "Django" or "React" file in github/gitignore — so the preset stacks above apply the real template that actually covers each (Python for Django, Node for React/Express) and say so.

Import an existing .gitignore

Already have a .gitignore from an older project? Drop the file onto the import box, or paste its contents, and this generator checks which of the 312 official templates your file's rules actually came from, pre-selects those, and shows a short diff of what the fresh, de-duplicated version adds on top of what you already had.

Common things you should always ignore

CategoryExamplesWhy
Dependenciesnode_modules/, vendor/, .venv/Reproducible from a lockfile; bloats the repo.
Build outputdist/, build/, target/, *.classRegenerated on every build.
Secrets.env, *.key, credentials.jsonNever commit credentials — a security risk.
Editor / IDE.vscode/, .idea/, *.swpPersonal, machine-specific config.
OS junk.DS_Store, Thumbs.db, Desktop.iniCreated automatically by the OS.
Logs / caches*.log, .cache/, coverage/Noise that changes constantly.

How to use the generated file

  1. Select your stack above (or use a preset) and click Download (or Copy).
  2. Save it as .gitignore in the root of your repository — note the leading dot and no file extension.
  3. Run git add .gitignore && git commit -m "Add .gitignore".
  4. If you've already committed files you now want ignored, untrack them with git rm -r --cached node_modules (for example), then commit again. Adding a rule alone doesn't remove files Git is already tracking.

Tips for a clean repository

Keep secrets out of Git from day one — commit a .env.example with placeholder keys instead of the real .env. Add a .gitignore before your first commit so artifacts never enter history (rewriting history later is painful). For monorepos, layer a small .gitignore in each package on top of the root one. And if you ever need to force-add an ignored file, git add -f path/to/file overrides the rule for that single file.

Once your repo is tidy, explore the rest of this hub: the Dockerfile generator builds an optimized multi-stage container image for the same stack, and the .htaccess generator produces Apache rules for HTTPS, caching and redirects.

Frequently Asked Questions

What is a .gitignore file? +
A .gitignore file tells Git which files and folders to leave untracked. Patterns like node_modules/, *.log or .env are never staged, committed, or shown as changes — keeping build artifacts, dependencies, secrets and OS junk out of your repository.
How do I create a .gitignore file? +
Select your languages, frameworks, editors and OS above, then click Copy or Download. Save the file as .gitignore in your repository root and commit it.
Can I combine multiple languages? +
Yes. Select as many templates as you need — they're merged into one file with section headers, and duplicate lines are removed automatically.
Are these the official GitHub templates? +
Yes — all 312 of them, not a hand-picked subset. They're the entire public-domain github/gitignore repository, bundled here so generation runs entirely in your browser.
How do I ignore a file already committed? +
.gitignore only affects untracked files. For an already-tracked file run git rm --cached <file> then commit; the rule keeps it out from then on.
Does this tool upload my data? +
No. Selections and generation run 100% client-side. The full template library's text content is fetched from this same origin on first use, but nothing you type, select or paste is ever sent anywhere.