Simple Git Ignore File For NodeJS

Sharing is Caring

Git is a source control system that is used for tracking and merging changes in code. If there’s files we want to push into source code for some reason we can use the .gitignore syntax.

Here’s a simple gitignore file that I start with most NodeJS projects. We definitely don’t want to include node_modules, build directories or npm-debug.logs as these will frequently change.

There used be a belief that we should check in node_modules but this isn’t necessary because of the package.json and package locking that can pin everything to specific versions.

node_modules
build
npm-debug.log
.nyc
.env
.DS_Store
Sharing is Caring

Brian is a software architect and technology leader living in Niagara Falls with 13+ years of development experience. He is passionate about automation, business process re-engineering, and building a better tomorrow.

Brian is a proud father of four: two boys, and two girls and has been happily married to Crystal for more than ten years. From time to time, Brian may post about his faith, his family, and definitely about technology.