.gitignore Generator

AI-powered

Describe your stack in plain English, or pick from a list of common environments — get a clean, deduplicated .gitignore.

Languages
Frameworks
Build & env
.gitignore · 6 sections
# Node.js
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
lerna-debug.log*
.npm
.yarn-integrity

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

# Env files
.env
.env.local
.env.*.local

# Vercel
.vercel/

# macOS
.DS_Store
.AppleDouble
.LSOverride
._*
.Spotlight-V100
.Trashes

# VSCode
.vscode/*
!.vscode/settings.json
!.vscode/extensions.json

01 — Overview

How the .gitignore Generator works

Generate a tidy, well-commented .gitignore for any combination of languages, frameworks, and tools. Two modes: describe your project naturally and let AI assemble the file, or pick stacks from a curated list. Sections are labelled, comments are kept, and entries are deduplicated.

02 — Use cases

When to use the .gitignore Generator

  1. 01

    Bootstrap a fresh repo with a sensible .gitignore in seconds

  2. 02

    Add a new language to an existing repo without searching for the right template

  3. 03

    Get a .gitignore for a polyglot project where no single template fits

  4. 04

    Audit your current .gitignore against best practice for your stack

03 — Examples

.gitignore Generator examples

Next.js app with Python data scripts and a Rust CLI

ex 01

# Next.js .next/ out/ # Python __pycache__/ *.py[cod] .venv/ # Rust target/ Cargo.lock

Three stacks merged with comment headers and no duplicate entries.

Select: Node.js, macOS, JetBrains, VSCode

ex 02

# Node node_modules/ npm-debug.log* # macOS .DS_Store # JetBrains .idea/ # VSCode .vscode/

Standard combo for a Node project on a Mac.

Go service with Docker and Terraform

ex 03

# Go bin/ *.exe # Terraform .terraform/ *.tfstate *.tfstate.* # Docker .env

Three toolchains merged, with Terraform state excluded because it routinely contains secrets.

Python project with Jupyter notebooks

ex 04

# Python __pycache__/ *.py[cod] .venv/ # Jupyter .ipynb_checkpoints/ # Data *.csv *.parquet

Adds the notebook checkpoint directory that trips up most Python templates.

04 — FAQ

.gitignore — frequently asked questions

Where does the template data come from?

The 'select' mode uses a curated set of templates derived from the github/gitignore repository, kept up to date with current best practice. The 'describe' mode uses AI to assemble a custom file for cases the curated set doesn't cover cleanly.

Is the order of entries significant?

Yes, but only in edge cases — later rules can override earlier ones with the ! prefix. The generator preserves a sensible order and avoids using ! unless you describe a need for it.

Should I commit .env files?

No. Commit .env.example with placeholder values; ignore .env and any .env.local variants. The generated .gitignore includes these by default.

Why is package-lock.json or pnpm-lock.yaml not ignored?

Lockfiles should be committed — they pin dependency versions for reproducible installs. The generator never adds them to .gitignore.

Does it handle nested .gitignore files?

Yes, indirectly: nested .gitignore files override the root one for their subtree. The tool generates root-level .gitignore content, but you can paste sections into nested files as needed.

How do I ignore a file that's already tracked?

A .gitignore entry only affects untracked files — Git keeps managing anything already in the index. Run git rm --cached path/to/file to untrack it while keeping it on disk, then commit. For a directory, add -r.

05 — Reference

Specs and further reading

The primary sources this tool follows. Where behaviour is defined by a specification, we link the specification rather than a summary of it.

  • gitignore documentation

    Git — The pattern format reference, covering negation, directory matching, and precedence.

  • github/gitignore

    GitHub — The community-maintained collection of per-language templates these outputs build on.

07 — More

Tools that pair with .gitignore

Last updated .