Hello SonarCloud Community,
I’m encountering an issue with default branch handling in SonarCloud when analyzing new projects.
Problem description
-
When I analyze a long‑lived branch that is also the repository’s default branch (for example
mainordevelop), SonarCloud always assigns it the namemaster, ignoring the actual branch name. -
This behavior happens only when the long‑lived branch is the default branch.
-
If the long‑lived branch is not the default branch, SonarCloud correctly shows the actual branch name.
Impact
Because of this:
-
mainordevelopis renamed tomasterinside SonarCloud -
All analysis results are attached to
master -
The real branch name is lost
-
In some cases, analysis data or code appears to be missing
-
The branch structure in SonarCloud does not match the repository
Expected behavior
-
If the default branch is
mainordevelop, SonarCloud should:-
Detect and use the correct default branch name
-
Keep all analysis and code associated with that branch
-
Avoid renaming it to
master
-
Actual behavior
-
When the default branch is analyzed as a long‑lived branch, it is always shown as
master -
Only non‑default long‑lived branches keep their real names
Goal
I want the default branch and all long‑lived branches to appear in SonarCloud with their real names, including all related code and analysis.
Is this expected behavior, a configuration issue, or a known limitation?
Any guidance would be appreciated.
Thank you!