Skip to content

Create a comprehensive .gitignore file in seconds!

Erica Pisani
Erica Pisani
1 min read

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.


📫
Enjoy this post? Subscribe to be notified when I publish new content!
tips-and-tricks

Comments


Related Posts

Members Public

How to install nvim-ufo in LazyVim to enable foldable code blocks

A feature that I've found myself missing since making the switch to Vim as my editor of choice is the ability to easily fold and expand code blocks. I know this functionality is included in Neovim, but I couldn't understand the native implementation enough to use

How to install nvim-ufo in LazyVim to enable foldable code blocks
Members Public

Git Log's Hidden Gems: Using -S and -L for Powerful Code History Search

Ever needed to track down when a specific piece of code was first introduced in a project? As part of some refactoring I had to do recently, I needed to do just that for a variable on a Django model. I was already familiar with the basic git log command,

Git Log's Hidden Gems: Using -S and -L for Powerful Code History Search
Members Public

Using XOR to write concise conditionals

It's not uncommon that I sometimes write if statements where the overall conditional is true when both conditions are true or both are false. As an example, let's say I'm validating input from an API call where I'm updating information on a