Gitignore in VSCode
July 25, 2019
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
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?
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):
It will generate a
.gitignore file based on the gitignore API.
Have a nice day.