Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I check the dotnet-tools .config directory into source control?

Recently I've noticed a .config directory being created by Visual Studio with a dotnet-tools.json file in. Should this be .gitignored or checked into source control?

like image 419
Jez Avatar asked Feb 11 '20 17:02

Jez


People also ask

Should I check in dotnet tools JSON?

It is more of a local configuration related to setup on local machine. If you want your colleague to install the same tools on her/his machine then you should check-in this file and your colleague is required to clone and run command to restore the same tool on her/his machine.


1 Answers

.config directory with dotnet-tools.json file is created when you install a tool for your project with dotnet tool install command. This file dotnet-tools.json contains details like version, installation command etc. about all the tools installed for your project. It is more of a local configuration related to setup on local machine. If you want your colleague to install the same tools on her/his machine then you should check-in this file and your colleague is required to clone and run command to restore the same tool on her/his machine. This is very much similar to NuGet packages.

You can safely add this to .gitignore. In this case, your collegue will still be able to perform a fresh install of the same tool using dotnet tool install with same or different version.

Here is a good article on this topic

like image 192
as-if-i-code Avatar answered Sep 23 '22 07:09

as-if-i-code