diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TrackReleaseBranchesVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TrackReleaseBranchesVersionStrategy.cs index f8d123eba7..2f2217c4ba 100644 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TrackReleaseBranchesVersionStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TrackReleaseBranchesVersionStrategy.cs @@ -43,8 +43,13 @@ public override IEnumerable GetVersions() => private IEnumerable MainTagsVersions() { - var main = this.repositoryStore.FindBranch(Config.MainBranchKey); - return main != null ? this.taggedCommitVersionStrategy.GetTaggedVersions(main, null) : Array.Empty(); + var main = this.repositoryStore.FindBranch(Config.MainBranchKey) + // For compatibility reason try to find `master` if `main` cannot be found + ?? this.repositoryStore.FindBranch(Config.MasterBranchKey); + + return main != null + ? this.taggedCommitVersionStrategy.GetTaggedVersions(main, null) + : Array.Empty(); } private IEnumerable ReleaseBranchBaseVersions()