Git / version control

Gitignore generator

Choose your stack, append project rules, and review the combined file before downloading.

Gitignore generator

Choose templates

Languages and frameworks
Operating systems
Editors

Selected: 0.

Custom rules, appended last

.gitignore result

Templates and rules are processed in this browser. No project files are read or uploaded.

Generation options

Only identical ordinary rules between negations are deduplicated. Every ! rule and the original order are kept.

Template sources and license

18 templates from github/gitignore, CC0-1.0. Snapshot commit 356fd7baab4c, dated 2026-09-11; checked 2026-09-16. Source comments stay in their original language.

Select a template or enter at least one rule.

Check with the rule tester
Send to rule tester

Choose content explicitly. A new same-origin tab receives it in memory for preview; no rules are stored or put in the URL.

A new repository often needs more than a language template: an operating system leaves metadata, an editor writes caches, and a project has its own local files. This Gitignore generator brings those sources together without assuming which environment you use.

Start with only the environments relevant to your project. Broad exclusions can hide files your team meant to share, so review both ordinary patterns and the exceptions before putting the result into a repository.

Why use this Gitignore generator

Combine sources you can trace

The Gitignore generator packages 18 GitHub templates with a pinned revision, source paths and a CC0 license record. Optional section comments show where each group came from. You can review a repeatable snapshot rather than relying on an API response that changes between visits.

Three template cards for code, operating systems and editors merge into one sectioned ignore file.

Keep the exception between repeated rules

In *.log, !important.log, *.log, the final rule excludes the file again. Removing that last line would change the outcome. Deduplication restarts at every negation and keeps all negations, so repeated rules on opposite sides of an exception survive.

An ignore rule, an exception and another ignore rule remain in sequence, with the final exclusion preserved.

Choose scope, then check precedence

01

Search without losing selections

Filtering the template list only changes visibility. The selected count still includes hidden choices, and output follows the fixed catalog order rather than your click order.

02

Place project exceptions deliberately

Custom ignore rules are appended after all templates. A later match can override an earlier match, but a file exception cannot reopen an excluded parent directory. Use cache/* rather than cache/ when an individual child needs to remain visible.

03

Verify a small set of real paths

Changes immediately disable old exports until generation finishes. To inspect matching, explicitly select custom input or the current result and send a compatible fragment to the tester. Large results remain available for full download.

What the combined file retains

Language, system and editor layers

Combine templates for Node.js, Python, Java, Go, Rust and other bundled stacks with macOS, Linux, Windows or editor rules. Unselected environments contribute no patterns.

Append an existing file

Paste an existing file as custom rules to generate .gitignore content with its lines at the end. LF, CRLF and CR inputs become LF; an initial BOM is removed. Meaningful leading and escaped trailing spaces remain.

Review cleanup without rewriting input

Safe deduplication reports the number of removed ordinary rules. Disabling it preserves repeated patterns. Opposing exact pattern pairs are counted but retained; this is not a solver for overlapping wildcards.

Inspect a fixed template snapshot

The gitignore templates are bundled from github/gitignore at commit 356fd7baab4c, dated 2026-09-11 and checked on 2026-09-16. Source links identify each original file, including its upstream comments.

Limits before adding the file to Git

Generation does not change tracking
No repository is opened, no tracked file is removed, and no history is rewritten. A newly added ignore pattern affects untracked paths; review index changes separately.
Ordering is preserved, not optimized
There is no alphabetical sorting, wildcard minimization or automatic resolution of conflicting intentions. The custom section runs last, but ignored parent directories still block child exceptions.
A curated snapshot needs review
These 18 templates do not cover every framework or guarantee secret detection. Check credentials, lockfiles and shared editor settings for your own project; a template cannot undo an exposed secret.
Input and output budgets
Custom input is limited to 50,000 UTF-16 code units, 2,000 physical lines and 512 units per line. Invalid Unicode and control characters except tabs/newlines are rejected. Copy and download include the entire generated file.
Transfer has a smaller scope
The existing tester allows 50 physical rule lines and 256 units per line, including a final empty line. A large generated file is not sliced silently. Remove comments or select a smaller original custom fragment.

Gitignore generator FAQ

Can I merge several stack templates?

Yes. Select the language, operating system and editor templates that apply. They are combined in a stable catalog order. Search does not remove selections, and custom rules are appended afterward.

Can I append my own ignore patterns?

Yes. Enter one pattern per line in the custom area. It also works with no template selected. You can keep comments, escaped leading # or ! characters, and project-specific exceptions.

Do I need an OS template?

Use one when the project may accumulate that operating system’s metadata. For a team-wide file, consider the systems used by teammates. Personal editor or OS exclusions can instead live in a global Git ignore file.

Why is Git still tracking an ignored file?

Adding a pattern does not stop tracking a file that is already in the index. Review whether it should be untracked, back up anything important and handle that change in Git. This tool only generates text.

Why does a negated rule fail to include a file?

A later rule can re-include a file only when Git can still traverse its parent directories. build/ blocks !build/keep.txt. Excluding build/* instead can leave the parent traversable, but always test representative paths.

Have a rule combination that needs explaining?

Prepare the next repository file

Use the Gitignore generator to assemble a reviewable starting point, inspect exceptions, and save the complete result as .gitignore. Put it in the intended directory only after checking what your team wants to track.