Skip to content
framework17 active rulesVerified 2026-09-30

NestJS .gitignore Template

NestJS framework dist outputs, coverage reports, and build cache. Generated and merged deterministically with upstream GitHub repository patterns to keep your repository clean of package directories, temporary build artifacts, and local environment files.

Interactive Stack Generator

Open in Full Generator
Search for templates
Quick add:
Selected1
NestJS
Selected Templates (1)
.gitignore
### NestJS ###
# Nestjs specific
/dist
/node_modules
/build
/tmp
# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# dotenv environment variable files
.env
.env.development
.env.test
.env.production
# temp directory
.temp
.tmp
17 rules1 template26 lines
Deterministic

Raw NestJS .gitignore

Crawlable upstream source template
nestjs.gitignore25 lines
# Nestjs specific
/dist
/node_modules
/build
/tmp
# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# dotenv environment variable files
.env
.env.development
.env.test
.env.production
# temp directory
.temp
.tmp

Key Pattern Breakdown

Dependencies & Packages

Excludes installed package directories and third-party vendor files that should be restored via package managers.

/node_modules

Build & Compilation Artifacts

Ignores compiled binaries, intermediate object files, and build output directories generated during development.

/dist/build

Environment & Secrets

Prevents leaking sensitive local credentials, API keys, database URLs, and environment configuration files.

.env.env.development.env.test.env.production

Cache & Temporary Files

Ignores compiler caches, test runner coverage data, and transient temporary scratch files.

/tmp*.lognpm-debug.log*pnpm-debug.log*yarn-debug.log*yarn-error.log*+2 more

Source & Verification

License:: CC0-1.0

Place this file in the root directory of your project as .gitignore. Changes take effect on newly added or untracked files.