Trying to understand how "next-version" property in GitVersion.yml works

Viewed 1232

I am confused about how next-version property works. I read the official documentation, it just a two line "only server as base version". I assume it will bump to the version I set on the next commit. But apparently it does not work like that. It seem like it adding current version number with the version number in the next-version, but it is not quite like that. Hope some one can explain it further. Thank you.

1 Answers

next-version is described in the documentation as:

Allows you to bump the next version explicitly, useful for bumping main or a feature with breaking changes a major increment.

You can think of next-version as a "future" git tag. The value of next-version should be equal to the value of the git tag you are going to add to your next release commit (a merge commit from develop to main, for instance).

As GitVersion is configured to increment either Major, Minor or Patch, for some branches you may want to exercise more control over which version part is incremented. Say GitVersion is configured to increment: Patch, but you know that there are features in develop that warrant a Minor or perhaps even Major increment. You can then use next-version to explicitly control the increment.

Related