When getting started with a project, there are some files and directories that we should not include in source control.

Files that contain credentials that should be kept secret (such as a .env file), or directories that contain the output of a build are a couple of examples.

Often, when we remember to include a .gitignore file in our project, there is a file or directory that we forget to add as we our project evolves.

Fortunately there’s a tool to help us with this! gitignore is a collection of .gitignore templates for popular programming languages and frameworks.

Using this is as easy as running npx gitignore <template> in your project, and a .gitignore file will be created with common files and directories to ignore for the language or framework that you specify.

While the template will likely include entries for tools that you are not using in your project, it’s a great place to start so you can work on the parts of your project that you’re most excited about quicker.