Luke Warren
Luke Warren

Reputation: 51

Does GitVersion support Mainline mode but with a develop branch?

We're using Mainline mode so that we don't have to tag every merge into master. But we use a 'develop' branch (sourced from 'master') and 'feature' branches (sourced from 'develop').

However our 'feature' branches seem to calculate versions based on the 'master' branch and not the 'develop' branch. Is there an easy fix to make the 'feature' branches base their version off of the 'develop' branch so their version relfect that they are working toward the next Minor release?

We automatically deploy prereleases built from 'develop' to our dev & qa environment. We automatically deploy stable versions built from 'master' to our staging environment (and then manually trigger them to deploy to production).

Does GitVersion support the following scenario:


we'd like this:


but are instead getting this:

mode: MainLine
branches: {}
ignore:
  sha: []

I've been banging my head against this for a week. I've read the docs, even downloaded the source code.

I've tried several combinations of mode, is-mainline, source-branches, etc, but always wind up with version collisions.

mode: MainLine
branches:
  develop:
    is-mainline: true
    is-source-branch-for: ['feature']
  feature:
    increment: Minor
    source-branches: ['develop']
ignore:
  sha: []

It seems like the only way to get GitVersion to predict the next stable version for both develop and feature branches is by using ContinuousDeployment mode and tagging commits on master.

Upvotes: 4

Views: 1392

Answers (1)

Luke Warren
Luke Warren

Reputation: 51

This solved my problem:

mode: Mainline
branches:
  feature:
    regex: ^feature?[/-]
    increment: Minor
  hotfix:
    tag: 'hotfix-{BranchName}'
ignore:
  sha: []
merge-message-formats: {}

Upvotes: 1

Related Questions