The pre-release output variables now use SemVer label terminology consistently:
| Previous variable | Replacement | Example value |
|---|---|---|
PreReleaseTag |
PreReleaseLabel |
beta.99 |
PreReleaseTagWithDash |
PreReleaseLabelWithDash |
-beta.99 |
PreReleaseLabel |
PreReleaseLabelName |
beta |
PreReleaseLabelWithDash |
PreReleaseLabelNameWithDash |
-beta |
The change applies to JSON output, formatting variables, build-agent environment variables, generated version-information files, and GitVersion.MsBuild outputs. PreReleaseNumber is unchanged.
GitVersion now targets .NET 10 only. The CLI, global tool, and GitVersion.MsBuild require a .NET 10 runtime. The MSBuild integration continues to support projects targeting earlier frameworks through its dotnet exec --roll-forward Major launcher, provided .NET 10 is installed.
GitVersion now packages GitVersion.Tool per runtime identifier. Install it with the .NET 10 SDK as before; NuGet automatically selects the dedicated package for Windows x64 and ARM64, Linux x64 and ARM64 (including musl), or Apple Silicon macOS.
GitVersion no longer ships native osx-x64 artifacts. Apple Silicon (osx-arm64) is now the only supported macOS target. Intel Mac users should continue using the last GitVersion v6 release that shipped an osx-x64 artifact.
CommitsSinceVersionSource is no longer emitted in JSON output, build-agent environment variables, generated version-information files, or the MSBuild GetVersion task. It can no longer be used in custom format strings. Use VersionSourceDistance instead; it has the same value.
GitVersion is migrating away from LibGit2Sharp and its native libgit2 binaries towards a managed implementation combined with the git CLI (#5031). A single environment variable selects the backend:
| Release | Default backend | Switch |
|---|---|---|
| v7.0 | libgit2 |
GITVERSION_GIT_BACKEND=managed to opt in to the new backend |
| v7.1 | managed |
GITVERSION_GIT_BACKEND=libgit2 to fall back |
| later | managed |
libgit2 backend removed |
Behavioral notes when using the managed backend:
- Mutating and network operations (repository normalization on CI build agents, dynamic repositories via
--url, checkout, fetch) are performed by invoking thegitexecutable, which must be available on thePATH. Plain version calculation on an already-prepared checkout does not require it. - v7.0 behavior is unchanged unless you opt in. Please test the
managedbackend and report issues — the libgit2 backend will be removed once the new backend has proven itself over several releases.
Previously bad label formatting config would be silently accepted. For example {Branhc} (when BranchName is misspelled) or even {BranchName (missing a closing brace). This is not ignored now and exceptions will be thrown if formatting problems exist in the label config. This brings it into line with how assembly string formatting is treated.
The command-line interface has been migrated from Windows-style (/switch and single-dash -switch) arguments to POSIX-style --long-name arguments using System.CommandLine.
Old-style arguments are no longer accepted by default. Update any scripts, CI pipelines, or tooling accordingly.
As a temporary migration aid, set the environment variable GITVERSION_USE_V6_ARGUMENT_PARSER=true to restore the legacy /switch and -switch argument handling. This escape hatch will be removed in a future release.
| Old argument | New argument | Short alias | Env var alternative |
|---|---|---|---|
/targetpath <path> |
--target-path <path> |
(positional path argument) |
|
/output <type> |
--output <type> |
-o |
|
/outputfile <path> |
--output-file <path> |
||
/showvariable <var> |
--show-variable <var> |
-v |
|
/format <format> |
--format <format> |
-f |
|
/config <path> |
--config <path> |
-c |
|
/showconfig |
--show-config |
||
/overrideconfig <k=v> |
--override-config <k=v> |
||
/nocache |
--no-cache |
||
/nofetch |
--no-fetch |
||
/nonormalize |
--no-normalize |
||
/allowshallow |
--allow-shallow |
||
/verbosity <level> |
--verbosity <level> |
||
/l <path> |
--log-file <path> |
-l |
|
/diag |
--diagnose |
-d |
|
/updateassemblyinfo [files] |
--update-assembly-info [files] |
||
/updateprojectfiles [files] |
--update-project-files [files] |
||
/ensureassemblyinfo |
--ensure-assembly-info |
||
/updatewixversionfile |
--update-wix-version-file |
||
/url <url> |
--url <url> |
||
/b <branch> |
--branch <branch> |
-b |
|
/u <username> |
--username <username> |
-u |
GITVERSION_REMOTE_USERNAME |
/p <password> |
--password <password> |
-p |
GITVERSION_REMOTE_PASSWORD |
/c <commit> |
--commit <commit> |
(no short alias) | |
/dynamicRepoLocation <path> |
--dynamic-repo-location <path> |
Critical:
-cpreviously referred to the commit id. It is now aliased to--config(config file path). Any usage of-c <commit-id>must be changed to--commit <commit-id>.
The GITVERSION_REMOTE_USERNAME and GITVERSION_REMOTE_PASSWORD environment variables can be used as alternatives to --username and --password. Environment variables take lower precedence than explicit CLI arguments.
-
The custom
ILoglogging abstraction has been replaced with the industry-standardMicrosoft.Extensions.Logging(M.E.L.) infrastructure using Serilog as the underlying provider. -
Removed public types from
GitVersion.Loggingnamespace:ILoginterfaceILogAppenderinterfaceLogLevelenumLogActiondelegateLogActionEntrydelegateLogExtensionsclass
-
Migration for custom integrations:
- If you were injecting
ILog, injectILogger<T>instead - If you implemented
ILogAppender, implementILoggerProviderinstead - The
Verbosityenum is preserved for CLI usage and maps to Serilog log levels internally
- If you were injecting
-
Preserved types:
Verbosityenum (Quiet/Minimal/Normal/Verbose/Diagnostic) - still used for CLI verbosity controlIConsoleinterface - moved fromGitVersion.LoggingtoGitVersionnamespace
- The configuration property
label-number-patternwas removed. The functionality can be still used by changing the label and the branch name regular expression for pull-request branches.
- Drop support for .NET Framework 4.8, .NET Core 3.1 and .NET 5.0. Changed the project targets to .NET 6.0 or later.
- Refactor caching system in GitVersion to use json files instead of yaml files. This change is not backwards compatible with the old caching system.
-
The configuration properties
continuous-delivery-fallback-tag,tag-number-pattern, andtagwere renamed tocontinuous-delivery-fallback-label,label-number-pattern, andlabelrespectively.tag-pre-release-weightandtag-prefixremained as they were as they are referring to a Git tag. -
When using a commit message that matches both
*-version-bump-messageandno-bump-message, there is no increment for that commit. In other words,no-bump-messagenow takes precedence over*-version-bump-message. -
The fallback version strategy now returns
0.0.0and is flagged withShouldIncrementequal totrue. This yields the version0.1.0on thedevelopbranch (IncrementStrategy.Minorby default) and0.0.1on themainbranch (IncremetnStrategy.Patchby default). -
The current branch (child) inherits its configuration from the source (parent) branch if the
incrementstrategy is set toInherit. This makes branch configuration recursive, simpler, more intuitive, more flexible, and more robust. -
Instead of having a single effective configuration, we now have one effective configuration per branch where the increment strategy is not set to
inherit. -
The new implementation of the branch configuration inheritance affects per default only the pull-requests, hotfix and feature branches. In this case the next version will be generated like the child branch is not existing and the commits have been made on the source branch.
-
The following example illustrates this behavior. On the feature branch the semantic version
1.1.0-just-a-test.1+2will now be generated instead of version1.0.0-just-a-test.1+3previously:* 1f1cfb4 52 minutes ago (HEAD -> feature/just-a-test) * 1f9654d 54 minutes ago (release/1.1.0) * be72411 56 minutes ago (develop) * 14800ff 58 minutes ago (tag: 1.0.0, main)
-
-
A new
unknownbranch magic string has been introduced to give the user the possibility to specify the branch configuration for a branch which is not known. A branch is not known if only the regular expression of the branch configuration with the nameunknownis matching. Please notice that this branch configuration behaves like any other branch configurations. -
Additional
fallbackbranch configuration properties have been introduced at the root to define base properties which will be inherit to the branch configurations. That means if no other branch configuration in the inheritance line defines the given property the fallback property applies. Notice that the inheritance tree can be controlled using the increment strategy property in the branch configuration section.-
The following example illustrates this behavior. The hotfix branch configuration overrides the main branch configuration and the result overrides the fallback branch configuration.
* 1f1cfb4 52 minutes ago (HEAD -> hotfix/just-a-test) * 14800ff 58 minutes ago (tag: 1.0.0, main)
-
-
When overriding the configuration with e.g. GitVersion.yaml the software distinguishes between properties who are not existent and properties who are
null. This is especially important if the user wants to define branch related configuration which are marked withincrementstrategyInherit. -
Following root configuration properties have been removed:
- continuous-delivery-fallback-tag
-
A new branch related property with name
track-merge-messagehas been introduced. Consider we have amainbranch and arelease/1.0.0branch and merge changes fromrelease/1.0.0to the main branch. In this scenario the merge message will be interpreted as a next version1.0.0whentrack-merge-messageis set totrueotherwise0.0.1. -
The pre-release tags are only considered when they are matching with the label name of the branch. This has an effect on the way how the
CommitCountSourcewill be determined. -
The process of increasing the version with bump message when
CommitMessageIncrementingis enabled and increment strategy isNonehas been changed. -
A new configuration property with name
version-in-branch-patternhas been introduced. This setting only applies on branches where the optionis-release-branchis set totrue. Please notice that the branch name needs to be defined after the version number by default (instead ofsupport/lts-2.0.0please name the branch likesupport/2.0.0-lts). -
The
is-release-branchproperty of thehotfixbranch setting has been changed fromfalsetotrue. If present the hotfix number will be considered now by default. -
In the GitHub and the Git Flow workflows the
labelproperty is by default set to an empty string on themainbranch. This yields to a pre-release version onmainwith an empty tag. Instead of for instance1.0.1+46GitVersion generates the full semantic version1.0.1-46instead. This behavior can be changed to generate only stable versions (no pre-release version) with setting the label tonull(Please keep in mind that thelabelproperty on root needs to be set tonullas well, otherwise the fallback applies). This change is caused by issue #2347. -
The
useBranchNamemagic string has been removed. Instead use{BranchName}forlabel. -
The
BranchPrefixToTrimconfiguration property has been removed.RegularExpressionis now used to capture named groups instead.- Default
RegularExpressionfor feature branches is changed from^features?[\/-]to^features?[\/-](?<BranchName>.+)to support using{BranchName}out-of-the-box - Default
RegularExpressionfor unknown branches is changed from.*to(?<BranchName>.+)to support using{BranchName}out-of-the-box
- Default
-
The
Mainlinemode and the related implementation has been removed completely. The newMainlineversion strategy should be used instead. -
The
Mainlineversion strategy doesn't support downgrading the increment for calculating the next version. This is the case if e.g. a bump messages has been defined which is lower than the branch increment. -
The branch related property
is-mainlinein the configuration system has been renamed tois-main-branch -
The versioning mode has been renamed to deployment mode and consists of following values:
- ManualDeployment (previously ContinuousDelivery)
- ContinuousDelivery (previously ContinuousDeployment)
- ContinuousDeployment (new)
-
At the configuration root level, a new array called
strategieshas been introduced, which can consist of on or more following values:- ConfiguredNextVersion
- MergeMessage
- TaggedCommit
- TrackReleaseBranches
- VersionInBranchName
- Mainline
-
The initialization wizard has been removed.
-
On the
develop,releaseandhotfixbranch the introduced branch related propertyprevent-increment.when-current-commit-taggedhas been set tofalseto get the incremented instead of the tagged semantic version. -
When setting the "ignore commits before" parameter to a future value, an exception will occur if no commits are found on the current branch. This behavior mimics that of an empty repository.
-
On the
GitFlowworkflow the increment property has been changed:- in branch
releasefromNonetoMinorand - in branch
hotfixfromNonetoPatch
- in branch
-
On the
GitHubFlowworkflow the increment property has been changed in branchreleasefromNonetoPatch. -
When creating a branch with name
hotfix/next(by using theGitFlowworkflow) orrelease/next(by theGitHubFlowworkflow) the resulting version will yield to a patched version per default. -
If you have a tag
1.0.0onmainand branch frommaintorelease/1.0.1then the next version number will be1.1.0when using theGitFlowworkflow. This behavior is expected (but different compared to theGitHubFlowworkflow) because on theGitFlowworkflow you have an addition branch configuration with name hotfix whereis-release-branchis set totrue. That means if you want1.0.1as a next version you need to branch tohotfix/1.0.1orhotfix/next. On the other hand if you use theGitHubFlowworkflow the next version number will be1.0.1because the increment on thereleasebranch is set toPatch. -
There is a new configuration parameter
semantic-version-formatwith default ofStrict. The behavior ofStrictis, that every possible non-semver version e.g.1.2.3.4is ignored when trying to calculate the next version. So, if you have three-part and four-part version numbers mixed, it will compute the next version on basis of the last found three-part version number, ignoring all four-part numbers. This is different compared to v5 where per default it was aLoosecomparison.
The following legacy output variables have been removed in this version:
BuildMetaDataPaddedLegacySemVerLegacySemVerPaddedNuGetVersionV2NuGetVersionNuGetPreReleaseTagV2NuGetPreReleaseTagCommitsSinceVersionSourcePadded
- Version numbers in branches other than
releasebranches are no longer considered as a version source by default. Implemented in #1541. - #1581 folds
GitTools.Coreback into GitVersion to make maintaining GitVersion easier.
When using GitFlow, a few things have changed. Hopefully the new settings just work for you
develophas pre-release tag ofalphanow, not unstable.developwill bump as soon as areleasebranch is created.- Look at the GitFlow examples for details of how it works now.
GitVersionConfig.yamlis deprecated in favor ofGitVersion.yml.- Regular expressions are no longer used as keys in branch config
- We have named branches, and introduced a
regexconfig which you can override. - The default keys are:
master,develop,feature,release,pull-request,hotfixandsupport - Just run
GitVersion.exein your project directory and it will tell you what to change your config keys to - For example,
dev(elop)?(ment)?$is now justdevelop, we suggest not overring regular expressions unless you really want to use a different convention.
- We have named branches, and introduced a
source-branchesadded as a configuration option for branches, it helps GitVersion pick the correct source branch
- NextVersion.txt has been deprecated, only
GitVersionConfig.yamlis supported AssemblyFileSemVervariable removed,AssemblyVersioningSchemeconfiguration value makes this variable obsolete- Variables
ClassicVersionandClassicVersionWithTagremoved - MSBuild task arguments (
AssemblyVersioningScheme,DevelopBranchTag,ReleaseBranchTag,TagPrefix,NextVersion) have been removed, useGitVersionConfig.yamlinstead - GitVersionTask's
ReleaseDateAttributeno longer exists