.gitignore Generator

Choose the stacks in your project and the editors and operating systems your team uses, and get a single .gitignore with one section per choice and no repeated lines. Add your own patterns, then test a path to see which rule ignores it before you commit.

Languages
Frameworks
Tools and cloud
Editors and IDEs
Operating systems

Relative to the repository root. End folders with /. This is a quick check of the rules above; run git check-ignore -v <path> for the final word.

Ignored by .env.*

Building the file runs in your browser. What you type never leaves this device.

Features

  • 29 templates: 9 languages, 9 frameworks, 4 tool sets, 4 editors and 3 operating systems

  • Duplicate patterns removed when templates overlap

  • Keeps .env.example and shared VS Code settings tracked while ignoring the rest

  • A Secrets and keys template for .env files, private keys and service-account JSON

  • Check a path: see whether it is ignored and by which rule

  • Download the file as .gitignore or copy it

When to generate a .gitignore

Starting a new repository

Add the file in the first commit, before node_modules, build folders or .env files get committed by accident.

Full-stack and monorepos

Combine Node, Python, Docker and your editors in one file instead of copying several templates by hand.

Cleaning up an existing repo

Regenerate the file, then untrack files that should never have been committed with git rm --cached.

How .gitignore rules work

Pattern basics

  • *.log ignores matching files in every folder.
  • build/ with a trailing slash ignores folders named build, not files.
  • A leading slash, /vendor/, matches only at the repository root.
  • ** matches any number of folders: **/*.bak.
  • !pattern re-includes something an earlier rule ignored. The last matching rule wins.

Already committed files

.gitignore only affects untracked files. If a file is already in the repository, adding it to .gitignore changes nothing until you run git rm --cached <file> and commit. If that file held passwords or API keys, change them: they are still in the history.

Re-including inside an ignored folder

Git cannot re-include a file if its parent folder is ignored. That is why the VS Code template uses .vscode/* (ignore the contents) instead of .vscode/ (ignore the folder) before !.vscode/settings.json.

.gitignore Generator - FAQ