.gitignore for NestJS
17 ignore rules for NestJS, ready to copy into your repository.
Node.js framework for building scalable applications
The complete .gitignore for NestJS
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-01-19 11:52:00 UTC
# Technologies: NestJS
### NestJS ###
/dist
/node_modules
/build
/tmp
logs
pnpm-debug.log*
# Lerna debug logs
lerna-debug.log*
# Environment variables
.env
# Log file
*.log
.env.development
.env.test
.env.production
# npm debug logs
npm-debug.log*
# Temporary files
.temp
# Yarn debug logs
yarn-debug.log*
.tmp
# Yarn error logs
yarn-error.log*
What these NestJS rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
Nestjs specific
| Pattern | What it ignores |
|---|---|
/dist |
Nestjs specific |
/node_modules |
Nestjs specific |
/build |
Nestjs specific |
/tmp |
Nestjs specific |
Logs
| Pattern | What it ignores |
|---|---|
logs |
Logs |
pnpm-debug.log* |
Logs |
lerna-debug.log* |
Lerna debug logs |
.env |
Environment variables |
.env.development |
Logs |
*.log |
Log file |
.env.test |
Logs |
.env.production |
Logs |
npm-debug.log* |
npm debug logs |
.temp |
Temporary files |
yarn-debug.log* |
Yarn debug logs |
.tmp |
Logs |
yarn-error.log* |
Yarn error logs |
How to use this .gitignore for NestJS
- Copy the NestJS rules above, or download the file directly.
- Create a file named .gitignore at the root of your Git repository and paste the rules into it.
- If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
- Commit the .gitignore so everyone on the team shares the same rules.