.gitignore generator
Tick languages, frameworks, operating systems and editors to build a deduplicated, grouped .gitignore in real time, add your own patterns and copy it in one click.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Pick templates
Selections merge live; duplicate ignore lines are kept once, with groups ordered languages → OS → editors.
Languages & frameworks
Operating systems
Editors & IDEs
Preview
# Node node_modules/ dist/ build/ coverage/ npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* .env .env.local .env.*.local !.env.example # macOS .DS_Store .AppleDouble .LSOverride ._* .Spotlight-V100 .Trashes Icon?
Plain text output — save it as .gitignore in your project root. Lines starting with ! un-ignore a path, and the order already follows Git precedence rules.
What this tool does
- Run git init on a new project and tick languages, OS and editor templates once to get a .gitignore that does not miss node_modules, .DS_Store or .idea.
- Merge templates for a polyglot repo (a Node service plus Python scripts): duplicated patterns are deduplicated instead of hand-copied twice.
- Audit an inherited repository by comparing your existing .gitignore against the generated one to spot missing build artifacts and local config files.
- Add internal conventions such as secrets/ or *.local with custom lines appended at the end, without editing the file by hand.
Example
Input
Templates: macOS and Vim; custom line: *.bak
Output
# macOS .DS_Store .AppleDouble .LSOverride ._* .Spotlight-V100 .Trashes Icon? # Vim *.swp *.swo *.swn .netrwhist tags # Custom *.bak
Groups are always ordered languages → OS → editors → custom, so the order you tick boxes does not change the output; a pattern shared by several templates is written once, where it first appears.
Frequently asked questions
Where should the .gitignore file live?
In the repository root it applies to the whole work tree; a nested .gitignore only affects its own directory and below. Patterns only affect untracked files, so a file that is already committed must be removed with git rm --cached before it disappears.
Why does dist/ appear only once when I pick both Node and Python?
The generator deduplicates across templates and keeps the first occurrence. The Node and Python templates both carry dist/, build/ and coverage/, so each pattern is written once instead of twice in the same file.
What do lines starting with ! mean?
A leading ! un-ignores a path. In the Node template .env hides your local environment files while the following !.env.example keeps the sample file committable. Such lines must come after the rule they override, and the generator keeps that order.
Does the tool read or modify my repository?
No. The templates are a built-in static list and the result is only rendered on the page for you to copy; the tool makes no network requests and never writes to your disk.
What if the generated patterns do not match my project?
The templates cover common conventions — dependency folders, build output, OS and editor droppings — and exact directory names differ between projects. Treat the output as a baseline and add your own conventions as custom lines.
Keywords:gitignoregitignore generator.gitignore 生成git ignore fileignore patternsnode gitignorepython gitignore忽略文件版本控制git 配置macos .DS_Store