Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitVersion: How do you increment the version of master branch after a pull request from release?

I am running GitVersion with GitFlow in Continuous Deployment mode with practically all default settings.

This is my GitVersion.yaml:

mode: ContinuousDeployment
continuous-delivery-fallback-tag: ''
branches: 
  master:
    tracks-release-branches: true
merge-message-formats: {}
ignore:
  sha: []

These are the steps I am taking:

  1. Create tag named 1.0.0 on the master branch
  2. Create the develop branch off of master (GitVersion shows this as 1.1.0, which is great, this is what I want)
  3. Create the feature/myfeature branch off of develop
  4. Create a commit to feature/myfeature
  5. Pull request from feature/myfeature -> develop
  6. At this point we are at 1.1.0, and this makes complete sense to me.
  7. Create the release branch off of develop
  8. If I run GitVersion, I am still at 1.1.0, again, this makes sense to me.
  9. Pull request from release -> master
  10. Master now shows the version is 1.0.1. Why is GitVersion not recognizing the history that I just pulled from the release branch?

The only thing that I can do to solve the issue is to manually generate a tag on my release branch, which GitVersion will then use to determine the next version. I do not want to create the tag until I pull into master, at which point I will generate a new build and set a tag on my master branch automatically via my pipelines in Azure.

like image 301
Colin Avatar asked Dec 01 '25 03:12

Colin


1 Answers

I was able to fix the problem by setting these configs in my GitVersion.yml:

branches:
  main:
    increment: None
    tracks-release-branches: true
mode: ContinuousDeployment
like image 85
Maxime Baker Avatar answered Dec 02 '25 20:12

Maxime Baker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!