Changing project name when project has no "main branch"

  • Latest SonarQube and scanner
  • I want to change a project’s name (and keep its history)
  • I have tried adding the new name as a parameter to the scan call as instructed, but this has no effect

I found an old topic that explained renaming is only possible when scanning the main branch. This is surprising behavior and, if still accurate, problematic for us, since, due to SonarQube’s limitations, the project does not have a main branch.(*)

  1. Is this still accurate?
  2. Is there a workaround? (I guess I could just create a temporary branch called master, run a single scan there, and then delete it…)
  3. Is there an open feature request for changing the name in the UI?

(*) The project’s actual main branch is called “main”. SonarQube expects it to be “master” instead. The project was created in SonarQube by scanning it, so a branch named “main” exists in SonarQube - but it is not the main branch. Therefor I can’t rename the main branch - a branch with that name, “main”, already exists! This behavior, too, is rather frustrating.




You can’t delete the main branch

No. We’ve never seen the need.

You may be interested in this feature: