I have a repo in azure and it has the default branch "main".
Also, I have a task in yml file for semantic versioning.
- task: gittools.gitversion.gitversion-task.GitVersion@5
displayName: Get Semantic Git Version
I am hitting the below error
No branch configuration found for branch personal/release1, falling back to default configuration System.InvalidOperationException: Could not find a 'develop' or 'master' branch, neither locally nor remotely.
So, I just created a develop branch and triggered build then the semantic version got succeeded.
We do not want to maintain develop or master branch as per guidelines.
How can we overcome the error without maintaining the master and develop branch?
Thanks
Naresh Ede
It looks that this is not supported yet by GitTools\GitVersion and it is still waiting for a solution.
But to overcome this you can provide GitVersion.yml file
mode: ContinuousDelivery
branches:
master:
regex: main
mode: ContinuousDelivery
tag:
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
feature:
regex: feature(s)?[/-]
mode: ContinuousDeployment
develop:
regex: dev(elop)?(ment)?$
mode: ContinuousDeployment
tag: alpha
hotfix:
regex: hotfix(es)?[/-]
mode: ContinuousDeployment
tag: beta
release:
regex: release(s)?[/-]
mode: ContinuousDeployment
tag: rc
ignore:
sha: []
And then use it like this
steps:
- task: GitVersion@5
inputs:
runtime: 'core'
configFilePath: 'GitVersion.yml'
updateAssemblyInfo: true