Azure devops GitVersion task failed

2.2k views Asked by At

As of this week I have noticed that when creating a new repository in azure devops the "master" branch no longer exists but was replaced by a "main" branch.

When I configure the pipeline for that new repository I use the GitVersion task that I have always used to version my artifacts in azure devops but since this change was made I get the following error:

System.InvalidOperationException: Could not find a 'develop' or 'master' branch, neither locally nor remotely.

Anyone know how I could solve this problem?

I would really appreciate your support.

1

There are 1 answers

1
Philippe On BEST ANSWER

Yes, a lot of tools or services in the git ecosystem is moving away from 'master' as the default branch: https://devblogs.microsoft.com/devops/azure-repos-default-branch-name/

No GitVersion release actually does support this new branch name.

See https://github.com/GitTools/GitVersion/issues/2433

Fix is there https://github.com/GitTools/GitVersion/pull/2367

So you have 2 possibilities :