.gitignore Generator — Node, Python, React, macOS & More

Tick your stack — Node, Python, React, Next.js, Docker, macOS, VS Code and 40 more — and get one clean, de-duplicated .gitignore with commented sections, ready to download.

Runs in your browser
.gitignore

Your data never leaves your computer. All processing happens 100% locally in your browser.

How to use the .gitignore Generator

  1. Pick everything your project uses — a language, a framework, your operating system and your editor. Or start with a preset.
  2. Use the filter to find templates quickly (“next”, “jet”, “docker”).
  3. Add project-specific paths in Your own rules; they’re appended at the end so they can override earlier rules with !.
  4. Download the file, save it as .gitignore in the root of your repository and commit it.

What belongs in a .gitignore?

Everything that is generated, machine-specific or secret: dependency folders (node_modules/, .venv/), build output (dist/, .next/), caches, logs, editor settings and .env files with credentials. Source code, lock files and configuration your team shares stay in Git.

PatternMatches
node_modules/The folder anywhere in the repo (trailing slash = directories only)
/distOnly dist in the repository root (leading slash anchors it)
*.logEvery file ending in .log, in any folder
**/temptemp at any depth
!.env.exampleRe-includes a file that an earlier rule ignored
# commentIgnored line — use it for section headers

Already committed a file you now want to ignore?

A .gitignore only affects untracked files. To stop tracking something that is already in the repository, run git rm --cached path/to/file and commit — the Git Command Generator builds the exact command. If you committed a secret, rotate it: removing it from the latest commit doesn’t remove it from history. Check your env files with the .env File Validator.

Project vs global ignore

OS and editor files (.DS_Store, Thumbs.db, .idea/) can also go into a global ignore file on your own machine: git config --global core.excludesFile ~/.gitignore_global. Many teams still add them to the project file so nobody commits them by accident. Pair your ignore file with an .editorconfig and a README when starting a new repository.

Tools that pair well with the .gitignore Generator

  • package.json Generator — Fill in a form and get a valid package.json — npm name validation, script presets for Vite, Next.js, Node and TypeScript libraries, exports, engines, license and repository — with warnings for common mistakes.
  • GitHub Actions Workflow Generator — Choose your stack, triggers and steps and get a commented .github/workflows/ci.yml — install, cache, lint, test, build, a version matrix and optional deploy to GitHub Pages, Vercel or a container registry.
  • Semantic Version Calculator — Everything about semantic versions in one place: compare two versions, calculate the next major/minor/patch/prerelease, and see exactly which versions an npm range like ^1.2.0 or ~2.3 allows — explained in plain English.
  • Changelog Generator — Paste your git log and get a tidy CHANGELOG.md section: commits grouped into Features, Bug Fixes, Performance and Breaking Changes, scopes in bold, links to commits — plus the next semantic version.

Frequently asked questions

Where do I put the .gitignore file?
In the root folder of your repository, named exactly .gitignore. You can add more .gitignore files in subfolders; their rules apply relative to that folder.
Why is a file still tracked after I added it to .gitignore?
Git only ignores untracked files. Remove it from the index with git rm --cached <file> (add -r for folders), then commit. The file stays on your disk.
Should I commit package-lock.json or yarn.lock?
Yes for applications — lock files make installs reproducible. That’s why this generator doesn’t ignore them.
Should .env be in .gitignore?
Yes. Ignore .env and .env.*.local, but commit a .env.example with the variable names and no real values so teammates know what to set.

Related tools