TeamCity - GitVersion generates the build number unexpected
I have the git commits and the tags as below
The tag of the latest commit is 12.0.0-beta.6. When I run GitVersion, the result is as below
So the build number on TeamCity should be 12.0.0-beta.6, but I don't know why the GitVersion generates build number 12.0.0-beta.6+8 on TeamCity.
My build steps are as below
Does anyone know why GitVersion generates the redundant "+8" after the FullSemVer? How to remove this dedundant "+8"? Thank you very much.
The +8
is metadata and not actually part of the version number. In the documentation for the version variables, BuildMetaData
is described as:
The build metadata, usually representing number of commits since the
VersionSourceSha
.
You can see the same value 8
exposed as CommitsSinceVersionSouce
and this should increase with every commit made to the branch since its "version source", which in this case is the tag 12.0.0-beta.6
made on commit 549a1d
.
The metadata does not increase with every build, but with every commit. I can see how the current language is confusing and the name BuildMetaData
does not help. Since BuildMetaData
is an exposed variable, we can't change its name, but I've submitted a PR that will hopefully clarify its documentation.