DevBento logoDevBento
Tools/.gitignore Generator/Gitignore for Next.js

Gitignore for Next.js

Generate a complete .gitignore for Next.js projects. Covers node_modules, .next build output, env files, and Vercel deployment files.

Languages & Runtimes
Editors & IDEs
Operating Systems
Frameworks & Tools
.gitignore1 template · 12 rules
# Next.js
.next/
out/
node_modules/
.env
.env.*
!.env.example
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.tsbuildinfo
.vercel
coverage/
# Generated with devbento.dev/tools/gitignore-generator
Send to:
Related Tools
.git.gitignore Generator
Generate .gitignore files for any project stack. Select from 30+ templates for languages, editors, and operating systems, then download or copy.
+/-Diff Checker
Compare two blocks of text side by side or inline with character-level highlighting. Find additions, removals, and changes instantly in your browser.

Gitignore for Next.js

This example generates a focused .gitignore for Next.js apps: App Router or Pages Router, deployed to Vercel or self hosted. It ignores dependencies, the framework build cache, environment files, logs, TypeScript build info, and deployment metadata.

What the Template Ignores

Pattern Reason
node_modules/ Installed packages, rebuilt from the lock file
.next/ Build output and dev cache from next build and next dev
out/ Static export output from next export
.env, .env.* Secrets, with !.env.example kept so the key list stays committed
npm-debug.log*, yarn-debug.log*, yarn-error.log* Package manager logs
*.tsbuildinfo TypeScript incremental build cache
.vercel Local Vercel link and deployment state
coverage/ Test coverage reports

How to Use

  1. The tool opens with the Next.js template preselected
  2. Add node, TypeScript, and your OS and editor templates for full coverage
  3. Click Generate, copy the result, and save it as .gitignore in your project root
  4. Verify with git status that .next/ and node_modules/ are untracked, then commit

Vercel Deploy Note

Vercel runs its own install and build, so it never needs your local .next/ or node_modules/. What it does need is a committed lock file and env values configured in the project settings. If a deploy fails on missing env, check the dashboard first, not the repo.

For related workflows, compare ignore files with the Diff Checker or build the full file in the Gitignore Generator.

🔒

Nothing you paste leaves this tab. Every tool runs entirely in your browser — no upload, no server, no account.

© 2026 devbento.dev · built local-firstAll ToolsChangelog