How to change the main branch in SonarQube?

Hey @justinmchase and @dbrin .

Unfortunately, changing the main branch in SonarQube takes a lot of changes in the underlying database. We didn’t feel comfortable introducing these changes late in the v9.x series as the LTS got closer.

The first sprint to properly prepare for this feature has been completed, so it is definitely coming.

You should be able to change sonar.projectCreation.mainBranchName under the global Administration > General > Project Creation.

I think you make an interesting point about default vs. main branch, considering this is the verbiage used across all the DevOps Platforms we integrate with (I just checked).

Can I ask that you raise this specific point over at Product Manager for a Day - Sonar Community?

This is also interesting. I’ll make a note to raise the point when we get closer to actually implementing changing the main branch. Synchronization between the DevOps Platform and SonarQube is an important topic for us.

2 Likes