The task gives you an easy way to standardise your versioning.
Usage:
In the pipeline of choice, you add the Task over the Task assistant by either entering the name in the search window or manually searching for the task.
When added, there should be a new task in the steps-section which is the GitDateVersion.
The task doesn't require any further inputs and should be in the steps higher than the task you want to use its variables.
During the build, it will install the Nuget-Package GitDateVersion which handles the creation of the Version-Number and the Nuget-Version-Number.
After adding it, there will be two variables available:
Variable-Name
Format
Example
$(version)
[Year].[Month].[Day].[Seconds]
2022.12.21.533
$(nugetversion)
[Year].[Month].[Day].[Seconds]-[Branch] for branches
2022.12.21.533-NewProject
These variables can futher be used, for example in the build-pipeline.
Usecase
The following image shows a potential use case of the GitDateVersion:
Output
While running the pipeline, in the Jobs-section the GitDateVsion will provide some addition information: