env.dev

.gitignore Generator

Generate safe, thorough .gitignore files. Every output includes a safety baseline (OS droppings, editor swap files, logs, secrets) and covers 50+ languages, frameworks, tools, editors, and platforms.

Last updated:

Start with a preset

Presets are additive — selecting one adds its templates; selecting more stacks them. A preset stays active while all its templates are included.

Strict dotfile mode

Ignore every dotfile by default and only allow known-safe ones (`.editorconfig`, `.nvmrc`, etc.). Safer for new tooling that drops unknown dotfiles.

Languages

1 / 14 selected

Frameworks

1 / 11 selected

Tooling

6 / 19 selected

Editors

8 / 8 selected

Platforms

3 / 7 selected
.gitignore Output223 lines
# ─── Generated by env.dev ────────────────────────────────────────────────
# .gitignore Generator — share or regenerate this config:
# https://env.dev/tools/gitignore-generator?ids=biome,claude-code,cursor,docker,editorconfig,emacs,eslint,github,husky,jetbrains,nodejs,pnpm,prettier,sublime,turborepo,vim,vite,vscode,zed&strict=1
# Presets: Node.js · Strict dotfile mode: on
# ─────────────────────────────────────────────────────────────────────────

# ─── Base (always ignored) ───────────────────────────────────────────────
# OS generated
.DS_Store
.DS_Store?
._*
.AppleDouble
.LSOverride
.Spotlight-V100
.Trashes
.Trash-*
Icon
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
desktop.ini
$RECYCLE.BIN/
*~
.fuse_hidden*
.directory
.nfs*

# Editor swap, backup, undo
*.swp
*.swo
*.sw?
*.bak
*.orig
*.rej
*.tmp
~*

# Logs & crash reports
*.log
logs/
crash.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Secrets & local env (never commit)
*.pem
*.key
*.p12
*.pfx
.env
.env.local
.env.*.local

# ─── Dotfiles (strict: ignore all, then allow known-safe) ────────────────
.*
!.babelrc*
!.browserslistrc
!.claude
!.claudeignore
!.cursor
!.cursorignore
!.cursorrules
!.dependabot
!.dockerignore
!.editorconfig
!.env.example
!.eslintignore
!.eslintrc*
!.gitattributes
!.github
!.gitignore
!.gitkeep
!.husky
!.mailmap
!.mcp.json
!.mergify.yml
!.node-version
!.npmignore
!.npmrc
!.nvmrc
!.pnpmfile.cjs
!.prettierignore
!.prettierrc*
!.python-version
!.tool-versions
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarnrc
!.yarnrc.yml

# ─── Node.js ───────────────────────────────────────────────────────────
node_modules/
jspm_packages/
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnpm-store/
*.tsbuildinfo
*.tgz
coverage/
.nyc_output/
lib-cov/
.grunt/
build/Release/

# ─── Vite ──────────────────────────────────────────────────────────────
dist/
dist-ssr/
*.local
.vite/

# ─── pnpm ──────────────────────────────────────────────────────────────
!pnpm-lock.yaml

# ─── Turborepo ─────────────────────────────────────────────────────────
.turbo/

# ─── Docker ────────────────────────────────────────────────────────────
docker-compose.override.yml
.docker/

# ─── Biome ─────────────────────────────────────────────────────────────
!biome.json
!biome.jsonc

# ─── ESLint ────────────────────────────────────────────────────────────
!eslint.config.*

# ─── Prettier ──────────────────────────────────────────────────────────
!prettier.config.*

# ─── VS Code ───────────────────────────────────────────────────────────
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
.history/
*.code-workspace
.vscode-test/

# ─── JetBrains ─────────────────────────────────────────────────────────
.idea/
*.iws
*.iml
*.ipr
out/
.idea_modules/
cmake-build-*/
atlassian-ide-plugin.xml
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# ─── Vim ───────────────────────────────────────────────────────────────
[._]*.s[a-v][a-z]
!*.svg
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
Session.vim
Sessionx.vim
tags
[._]*.un~

# ─── Emacs ─────────────────────────────────────────────────────────────
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
*_archive
*_flymake.*
/eshell/history
/eshell/lastdir
/elpa/
*.rel
/auto/
.cask/
flycheck_*.el
/server/
/network-security.data

# ─── Sublime Text ──────────────────────────────────────────────────────
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project
sftp-config.json
sftp-config-alt*.json
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
Package Control.merged-ca-bundle
Package Control.user-ca-bundle
oscrypto-ca-bundle.crt
bh_unicode_properties.cache
GitHub.sublime-settings

# ─── Zed ───────────────────────────────────────────────────────────────
.zed/

# ─── Claude Code ───────────────────────────────────────────────────────
.claude/settings.local.json
.claude/worktrees/

How to Use .gitignore Generator

  1. 1Pick a starting point: Base (safety floor only), Recommended (adds GitHub, GitLab, EditorConfig), or Clean slate.
  2. 2Toggle "Strict dotfile mode" to ignore all dotfiles by default and allow only known-safe ones (safest option).
  3. 3Select the languages, frameworks, tools, editors, and platforms you use. Dependencies (e.g. Next.js → Node.js) are added automatically.
  4. 4Click "Copy" or "Download" to grab the generated .gitignore.

Frequently Asked Questions

What makes this safer than other .gitignore generators?

Every output includes a non-negotiable safety baseline — OS files (.DS_Store, Thumbs.db), editor swap files (*.swp, *~), logs, and secret-shaped files (.env, *.pem, *.key) are always ignored. Individual language templates add exceptions on top, never remove from the safety floor.

What is "Strict dotfile mode"?

It ignores every dotfile by default (.*) and explicitly allows only known-safe ones like .editorconfig, .gitattributes, .nvmrc, etc. Any new tool that drops a dotfile into your repo is ignored unless you opt in. This is how experienced teams write their .gitignore.

What templates are available?

Covers the most popular languages (Node.js, Python, Go, Rust, Java, Ruby, PHP, .NET, Swift, etc.), frameworks (Next.js, Nuxt, SvelteKit, Astro, Remix, Angular, React Native, Flutter, TanStack Start, and more), tooling (Docker, Terraform, Pulumi, AWS CDK, pnpm, Yarn, Bun, Deno, Turborepo, Nx, Biome, Changesets, …), major editors (VS Code, JetBrains, Vim, Emacs, Sublime, Zed, Cursor, Claude Code), and platforms (GitHub, GitLab, Bitbucket, CircleCI, Dev Containers, Husky). Anything not covered can be added by hand — just edit the generated file.

How do presets work?

Presets are additive bundles. Clicking Node.js adds its templates; clicking Python on top adds Python too. A preset stays highlighted only while all of its templates are in your selection — untoggle any one template and the preset deactivates, but your other choices remain.

Can I share or re-open a configuration?

Yes. Your selection is encoded into the URL as you tweak it, so bookmarking or sharing the page link lets anyone regenerate the same .gitignore. The generated file also includes a header comment with the share link.

Where should I place the .gitignore file?

Place it in the root of your Git repository. Git reads it automatically and excludes matching files from version control. You can also have additional .gitignore files in subdirectories for scoped rules.