About the .gitignore Generator
This tool takes GitHub's official template collection, github/gitignore, as is, merges several templates into one file and cleans up overlapping rules. You can check what your rules actually ignore in the pattern tester, which implements the same matching rules as git. Everything runs in your browser; your rules and paths are never sent to a server.
Features
- Search and multi-select 312 templates — Search language, framework, OS, editor, tool and community templates by name and merge several into one file. Press Enter to add the first result.
- Deduplication that preserves meaning — When several templates contain the same rule, the later copy is removed — unless a `!` negation rule sits between them, because removing it could change the result.
- Section headers and original comments — Each template gets a header with its source path so you can later tell where a rule came from. You can also drop the original comments and keep only rules.
- Popular presets — Select common stacks such as Node + macOS + VS Code, Java + Maven + IntelliJ or Unity + Visual Studio in one click.
- Pattern tester — Paste a list of paths to see whether each is ignored and which rule (with line number) decided it. Negation `!`, trailing `/`, `**`, anchoring and excluded parent directories are evaluated the same way git does.
- Untrack command builder — Builds `git rm --cached` commands for bash/zsh or PowerShell to stop tracking files that were already committed.
- Copy, download and share — Copy the result or save it as a `.gitignore` file. Selected templates are stored in the URL (`?t=`) so you can share a link.
How to use
- Search and tick templates in the list, or click a popular combo. Usually you pick one or two languages/frameworks plus your OS and editor.
- Check the result on the right. Toggling Remove duplicate rules, Section headers or Keep original comments updates it instantly. Put project-specific rules in Add your own rules.
- Use Copy or Download to create
.gitignoreat the repository root. If your browser saves it asgitignore, rename it to add the leading dot. - Click Test to send the rules to the pattern test tab. Paste paths from your repository (the output of
git ls-filesorfind . -type fworks well) and confirm they are ignored as intended. - If files that are already committed are not ignored, build the commands in the Untrack tab, run them and commit.
Template data and license
The 312 templates come from commit 356fd7b (2026-09-11) of the github/gitignore repository, which is released under CC0-1.0 (public domain dedication) and may be copied, modified and redistributed freely. The root folder holds languages and frameworks, Global holds OS, editor and tool templates, and community holds specialized ones. The template explanations and all other text on this site were written by this site.
Frequently asked questions
I added a file to .gitignore but it still shows up in git status.
.gitignore only applies to files that are not tracked yet. A committed file must be removed from the index with git rm --cached <file> and committed before it is ignored. The Untrack tab builds these commands for you.
I re-included a file with `!` but it is still ignored.
When a parent directory itself is excluded, git never looks inside it, so files below cannot be re-included with !. Exclude the directory's contents instead, e.g. logs/* rather than logs/, then add !logs/keep.txt. The pattern tester flags this case as 'Ignored (parent dir)'.
Does removing duplicates change what the rules mean?
git follows the last matching rule. If the same rule appears again with no ! rule in between, removing the later copy gives the same result. When a negation rule sits in between, this tool keeps the duplicate.
Does the pattern tester match real git?
It follows gitignore(5) and git's wildmatch behavior, and thousands of random patterns and paths were compared against real git ls-files --ignored output with matching results. It does not combine nested .gitignore files, .git/info/exclude or global settings, so use git check-ignore -v for a repository-wide verdict.
Should macOS and VS Code rules go in the project .gitignore?
Files created by your OS and editor belong to your personal environment, so a global gitignore set with core.excludesFile is the recommended place. Many teams still add them to the project file because not every contributor configures a global one.
How current is the template data?
A build script downloads the github/gitignore repository and bundles it. The source commit and date are shown on the About page, at the bottom of the templates list and in the header comment of every generated file.
Is anything I type stored or sent?
No. Generating, testing and building commands all run in your browser. Only the light/dark theme and generator options are stored in this browser's localStorage.