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.
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 :
switch back to 'master' branch (see the setting to set in Azure Devops in the first link above) and you will have to rename the branch yourself.
update GitVersion configuration while waiting for the release with the fix. See https://github.com/GitTools/GitVersion/issues/2433#issuecomment-725586659