What is "main" branch in community edition?

I am using Sonarqube Community Edition - Version 10.3. My repo is in bitbucket. So what is the meaning of “main” branch? How does sonarqube decide what is main from repo?

I created a repo with initial branch as develop and another repo with initial branch as testing, will both of them get scanned if I run(not ran yet as code not ready) sonar scan.

I also have another repo which had master as initial brach when repo was created and now the default branch is changed to develop(master is still there), so which branch will get scanned if I run sonar scan in this repo?

Hi,

Welcome to the community!

In Community Edition, there’s only one branch per project. That one branch is whichever one you check out before running analysis.

Does that help?

 
Ann

Thanks for the reply. Does that mean if I switch to another branch form my terminal and run sonar analysis, this will also reported in the sonarqube UI?

~Givin

Hi Givin,

Yes. And to be clear, it will overwrite the other branch unless you use a different sonar.projectKey value.

 
HTH,
Ann

1 Like