.gitignore สำหรับ NestJS
กฎการละเว้นสำหรับ NestJS จำนวน 17 ข้อ พร้อมคัดลอกไปใช้ในคลังโค้ดของคุณ
กรอบงาน Node.js สำหรับการสร้างแอปพลิเคชันที่ปรับขนาดได้
.gitignore ที่สมบูรณ์สำหรับ NestJS
# สร้างโดย LFGitignore - https://lfgitignore.com
# สร้าง: 2026-10-31 23:48:24 UTC
# เทคโนโลยี: NestJS
### NestJS ###
/dist
/node_modules
/build
/tmp
logs
pnpm-debug.log*
# บันทึกการดีบักของ Lerna
lerna-debug.log*
# ตัวแปรสภาพแวดล้อม
.env
# ไฟล์บันทึก
*.log
.env.development
.env.test
.env.production
# บันทึกการดีบัก NPM
npm-debug.log*
# ไฟล์ชั่วคราว
.temp
# บันทึกการดีบัก Yarn
yarn-debug.log*
.tmp
# บันทึกข้อผิดพลาด Yarn
yarn-error.log*
สิ่งที่กฎ NestJS เหล่านี้มองข้ามไปจริงๆ
ทุกรูปแบบด้านล่าง และทำไมมันถึงอยู่ใน .gitignore ของคุณ
เฉพาะ Nestjs
| รูปแบบ | สิ่งที่กฎนี้ละเว้น |
|---|---|
/dist |
เฉพาะ Nestjs |
/node_modules |
เฉพาะ Nestjs |
/build |
เฉพาะ Nestjs |
/tmp |
เฉพาะ Nestjs |
บันทึก
| รูปแบบ | สิ่งที่กฎนี้ละเว้น |
|---|---|
logs |
บันทึก |
pnpm-debug.log* |
บันทึก |
lerna-debug.log* |
บันทึกการดีบักของ Lerna |
.env |
ตัวแปรสภาพแวดล้อม |
.env.development |
บันทึก |
*.log |
ไฟล์บันทึก |
.env.test |
บันทึก |
.env.production |
บันทึก |
npm-debug.log* |
บันทึกการดีบัก NPM |
.temp |
ไฟล์ชั่วคราว |
yarn-debug.log* |
บันทึกการดีบัก Yarn |
.tmp |
บันทึก |
yarn-error.log* |
บันทึกข้อผิดพลาด Yarn |
วิธีใช้ .gitignore นี้สำหรับ NestJS
- คัดลอกกฎ NestJS ด้านบน หรือดาวน์โหลดไฟล์โดยตรง
- สร้างไฟล์ชื่อ .gitignore ที่รากของที่เก็บ Git ของคุณ และวางกฎลงไป
- หาก Git ติดตามไฟล์เหล่านั้นอยู่แล้ว ให้เรียกใช้ git rm -r --cached . แล้วคอมมิตอีกครั้ง เพราะกฎการละเว้นของ Git มีผลเฉพาะกับไฟล์ที่ยังไม่ได้ติดตาม
- คอมมิตไฟล์ .gitignore เพื่อให้ทุกคนในทีมใช้กฎเดียวกัน