How to change the main branch in SonarQube?

Hello @markluebbehuesen,

The behaviour on SonarQube 8.5 is the same as on 7.9. The only difference with 8.5 is that it is now allow to analyze a “non main” branch before the main branch (which was not possible in 7.9), and I think that what caught you in a trap. My guess from what you describe is that you analyzed the develop branch first and you passed sonar.branch.name=develop which caused to create a non main branch before the main one (which was not possible in 7.9).

The best way to fix the problem is to delete the project and start again analyzing the 7.9 way:
– Not passing any sonar.branch.name parameter when analyzing develop (this will create a branch initially called master that you can rename as develop)
– Analyzing master by passing the parameter sonar.branch.name=master

Olivier

1 Like