0

We want to integrate GitVersion in our build pipeline for semantic versioning.

We are seeing the following error on a repo which doesn't have develop branch:

ERROR [06/07/22 16:04:53:53] An unexpected error occurred: System.InvalidOperationException: Could not find a 'develop' or 'master' branch, neither locally nor remotely. at GitVersion.Configuration.BranchConfigurationCalculator.InheritBranchConfiguration(Branch targetBranch, BranchConfig branchConfiguration, Commit currentCommit, Config configuration, IList`1 excludedInheritBranches) in D:\a\GitVersion\GitVersion\src\GitVersionCore\Configuration\BranchConfigurationCalculator.cs:line 62

I tried to add the gitVersion.yml config file as suggested here - but it didn't help.

Is there a way to overcome this issue without creating develop branch? we don't want to maintain a branch just to overcome this issue.

Thanks!

mikus
  • 3,042
  • 1
  • 30
  • 40
thechmodmaster
  • 709
  • 2
  • 7
  • 18
  • Based on the other answer, did you change this part to whatever your branch name is: "master: regex: **main**" ? – TTT Jun 08 '22 at 17:43
  • yes, my regex is: (master|main) and I'm working with master. Anyways, the issue is with develop branch which i don't have and don't want to create and maintain just to overcome this error. – thechmodmaster Jun 09 '22 at 13:17
  • I confess I know nothing about gitversion, but the way I interpret the error is that it can't find your `master` branch either. I get the impression it's looking for either `develop` or `master`, and if just one of them existed, it would be OK with it, but it can't find either of them, thus the error. (Obviously I could be wrong, but that would be a strange way to word the error message if it found `master` but not `develop`, and it needed both.) – TTT Jun 09 '22 at 14:31
  • Yes, it’s sounds logical. And the strange thing it worked before on this repo. – thechmodmaster Jun 09 '22 at 18:09

0 Answers0