DEV Community

Chuck
Chuck

Posted on

Gitignore in VSCode

This week I published an article about automating the creation of a LICENSE file for GIT in VSCODE. I wanted to consider the same methodology for the obligatory .gitignore file.

As you probably already know, the gitignore file is used in your local GIT repository to ignore files, like node_modules directory and env files which may contain API keys, to exclude them from your repository.

Just like with the LICENSE file example, you could easily copy a gitignore file from another repository and include it in your next commit, but there is an EASIER way?

alt text

VSCode Extensions

If you are using Vscode as your IDE, you already know there are a ton of extensions for almost everything you need. Today, I found this nifty extension, called .gitignore Generator which installs a .gitignore file, specific for your type of project, to your root project directory.

So, to use, go to the Command Palette, and type gitignore, and select Generate .gitignore File. A selection box will pop-up (see below):

Screenshot of selection menu.

It will generate a .gitignore file based on the gitignore API.

Have a nice day.

Top comments (2)

Collapse
 
thomasbnt profile image
Thomas Bnt ☕

Hello nice post, but please not fully upcase on your title 🙌

Collapse
 
eclecticcoding profile image
Chuck

Sorry was an oversite but glad you enjoyed the post.