Skip to main content

Gitignore Generator

Build a .gitignore from language and tooling presets with custom patterns.

Written by Golam Rabbani, Founder & Lead Engineer

Pick the languages, frameworks, and platforms in your project. Patterns are de-duplicated and grouped with comments, ready to drop into a .gitignore file. All processing runs in your browser.

Presets (0 selected)

Anything specific to your project, e.g. coverage/, .cache/, my-secret.json

How to use this gitignore generator

  1. Tick the language, framework, and platform presets that match your project (you can pick more than one).
  2. Add any project-specific paths in the Custom patterns box, one per line.
  3. Click Generate to combine the presets, de-duplicate identical lines, and label each block with a comment.
  4. Click Copy .gitignore and paste the result at the root of your repository.
  5. Run git rm -r --cached . then git add . to apply the new ignore rules to already-tracked files.

About this gitignore generator

The gitignore generator builds a clean .gitignore from a curated set of language, framework, IDE, and OS presets. Each preset is sourced from the official GitHub gitignore repository and similar community references, then bundled with the tool so generation is entirely local — no requests leave your browser.

Behind the scenes the tool merges every selected preset, removes duplicate lines so you do not get two copies of `node_modules/`, and writes each preset under a labelled comment block so you can see where every rule came from. Custom patterns you add get their own "Custom" section at the bottom.

As a concrete example, ticking Node.js, Next.js, VS Code, and macOS for a typical Next.js project produces:

# Node.js node_modules/ npm-debug.log* .npm

# Next.js .next/ out/ next-env.d.ts .vercel

# VS Code .vscode/* !.vscode/settings.json *.code-workspace

# macOS .DS_Store ._*

That is exactly the file you should commit at the root of the repo. After committing, run `git rm -r --cached .` followed by `git add .` to stop tracking files that the new rules now exclude.

FAQ

Where in the repository should the .gitignore file live?
The most common place is the repository root — Git applies those rules to every directory below it. You can also drop a local .gitignore inside a subfolder if you only want rules to apply to that subtree.
Does the gitignore generator send my selection to a server?
No. The preset library is bundled with the page, so generation, de-duplication, and concatenation all happen in your browser. Nothing is uploaded, logged, or stored anywhere.
Why are some entries prefixed with an exclamation mark?
A line starting with `!` is a re-include rule. For example, the VS Code preset ignores `.vscode/*` but re-includes `!.vscode/settings.json` so committed team settings are still tracked. Order matters — re-includes must come after the broader ignore.
How do I make Git stop tracking a file I have already committed?
Adding a path to .gitignore only stops new files from being tracked. For files already in the index, run `git rm --cached path/to/file` to untrack them, then commit. After that, the .gitignore rule will keep them out of future commits.
Can I add my own custom patterns alongside the presets?
Yes — the Custom patterns box accepts any valid gitignore line: globs (`*.log`), directory paths (`build/`), explicit files (`secrets.json`), and re-includes (`!.env.example`). Custom entries are written to their own commented block at the end of the file.
Is this gitignore generator free to use?
Yes, it is completely free with no account, no signup, and no usage limits.