This is a simple dotnet tool that extends the dotnet cli to generate a .gitignore file for Visual Studio/.NET projects.
I like to use the dotnet cli to create projects while working with VSCode and it bugged me that I need to track down a .gitignore file every time I wanted to create a new project.
The tool downloads the official Visual Studio .gitignore from GitHub. It also caches a copy in your user profile folder in the event that you are offline.
To install use the dotnet cli tool install command:
dotnet tool install -g dotnet-gitignore
This will install the tool globally. See this page for more information.
Note: You likely will need to restart your terminal to update your path before the dotnet gitignore
command will work.
The tool installs as a dotnet cli extension and can be run using:
dotnet gitignore
Currently the tool only accepts a single argument: the path where to .gitignore should be generated. If no path is specified, then the current working directory is used.
dotnet gitignore ../
dotnet tool update -g dotnet-gitignore
dotnet tool uninstall -g dotnet-gitignore