Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between GitVersion.Tool and GitVersionTask

Tags:

gitversion

I see that there are two nuget packages GitVersion.Tool and GitVersionTask

What is the difference between the two and what to use when.

I also see that GitVersion, but looks like this is deprecated, because the last update was two and half years ago. So lets ignore that.

like image 872
VivekDev Avatar asked Jun 19 '26 04:06

VivekDev


1 Answers

I believe I am right in saying that the GitVersion package can be ignored. This is no longer used, or recommended.

GitVersion.Tool is a .Net Global Tool version of GitVersion. You can install this using globally on your machine using the following:

dotnet tool install --global GitVersion.Tool

This requires the prior install of the .Net Core CLI tools in order for it to work. With both of these things installed, you can then run dotnet-gitversion to assert the version number of your repository.

GitVersionTask is a NuGet package that you would add to your project within Visual Studio. It includes MSBuild Targets which runs GitVersion during the compilation stage, asserting the version numbers of the repository, which can then be used in other parts of the MSBuild build.

GitVersion.CommandLine is similar to the GitVersion.Tool package, with the exception that this is intended for use with full .Net Framework, and not .Net Core.

GitVersion.portable is essentially the same as the GitVersion.CommandLine package, but it is shipped as a Chocolatey package. This means that you can install is globally on your machine using the command:

choco install gitversion.portable
like image 139
Gary Ewan Park Avatar answered Jun 24 '26 01:06

Gary Ewan Park