11

I am trying to change my main branch in Sonarqube from master to mainline as I have been doing my analysis on mainline for the past few months.

This post below in the Sonar community says that I have to delete the mainline branch then rename the master branch. The problem with this approach is that I would lose all of my history which I do not want to do. https://community.sonarsource.com/t/how-to-change-the-main-branch-in-sonarqube/13669/37

Is there anyway to change the main brach to another branch without losing all of our scan history?

Using: Developer Edition - Version 9.2.1

Picture of Branches

Zach
  • 143
  • 1
  • 1
  • 6
  • Have you tried the steps mentioned here https://community.sonarsource.com/t/how-to-change-the-main-branch-in-sonarqube/13669?page=2 – Sourav Apr 07 '22 at 17:51
  • 2
    Yes, I linked that thread in the question. It requires you to delete your old branch which I don't want to do because I want to keep the history – Zach Apr 08 '22 at 18:54
  • 1
    Update: this feature under development as of April 2023 & is expected in 10.X. There is a tile for setting a new main branch on the roadmap https://www.sonarsource.com/products/sonarqube/roadmap/. This comment has additional details: https://community.sonarsource.com/t/how-to-change-the-main-branch-in-sonarqube/13669/55 – AnthonyW May 15 '23 at 14:51

0 Answers0