Generate a complete .gitignore for Next.js projects. Covers node_modules, .next build output, env files, and Vercel deployment files.
# 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
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.
| 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 |
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.