GitVersion is a tool that generates a Semantic Version number based on your Git history. The version number generated from GitVersion can then be used for various different purposes, such as:
- Stamping a version number on artifacts (packages) produced during build.
- Exposing the version number to the build server to version the build itself.
AssemblyInfo.cs(and similar) files with the version number during the build, so the version number is embedded within the compiled binaries themselves.
There are four different ways to consume GitVersion itself. You can find each of these options below.
GitVersion can be used in a Continuous Server pipeline to generate a version number that both labels the build itself and makes the different version variables available to the rest of the build pipeline.Continuous Integration
The Command Line gives most flexibility by allowing the execution of GitVersion to be customizedCommand Line
Just install with NuGet and GitVersion will automatically generate assembly version information that is compiled into the resulting artifact.MSBuild Task
Install with NuGet and use GitVersion as a software library. Although this is an unsupported option and the API may break even between minor or patch releases, it's a useful option to some.Library
If you're unsure about how you should consume GitVersion or want to learn more about how it works, read the sections below.
Technical reference documentation.
|Configuration||Details about how GitVersion can be configured to suit your needs|
|Version Variables||The version variables exposed by GitVersion|
|Requirements||Requirements for successful operation of GitVersion|
|Version Incrementing||Details on how GitVersion performs version increments|
|Version Sources||Details on how GitVersion finds a source for its generated version number|
|Versioning Modes||The different modes of versioning GitVersion supports|
|Build Servers||Details on GitVersion's Build Server support|
More in depth information about GitVersion