Gitversion: Increment version number when local changes are detected

Created on 17 Jan 2019  路  9Comments  路  Source: GitTools/GitVersion

Checking out a project that produces nuget packages on build with GitVersionTask where master branch's latest commit is tagged with 2.0.0. It would be nice to increment the patch number when local changes are detected.

Or when you create a feature branch from master that is still tagged with 2.0.0 it should bump the minor version when local changes are detected.

Most helpful comment

Actually I'd like to get back to this!

All 9 comments

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

+1 for me. Will think about creating PR for this.

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

We solved it with a MSBuild.Tasks nuget package with a build target that adds VersionSuffix

<Target Name="NugetCreator_BeforeCreateNuspecChangesAndOutput"
          BeforeTargets="GenerateNuspec"
          AfterTargets="GetVersion"
          Condition="'$(GetVersion)' != '' and '$(DisableNugetCreatorForThisSolution)' != 'true'">
    <PropertyGroup>
      <VersionSuffix Condition="'$(CIBuild)' != 'true'">local$([System.DateTime]::Now.ToString(yyyyMMddHHmmss))</VersionSuffix>
      <PackageVersion Condition="'$(CIBuild)' != 'true'">$(VersionPrefix)-$(VersionSuffix)</PackageVersion>
    </PropertyGroup>
</target>

It would be awesome if you, @marcusl or @casz, could submit a PR that fixes this.

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

Actually I'd like to get back to this!

@marcusl @julianbartel please review #2069

Should be handled outside of GitVersion.

Was this page helpful?
0 / 5 - 0 ratings