Change main branch

Is it possible for us to change the main branch for a project? Currently sonarcloud has the main branch as master (which was the main branch) but the actual main branch of the repo is now develop, and we would like to reflect this in sonarcloud.

I would like to keep the history for the develop branch so the answers advising to delete and recreate the project are not ideal.

Can anyone help?

Hey there.

At this time, unfortunately, there’s no way to non-destructive change the main branch (to not lose the existing history).

After a long wait, we’re introducing the ability to do this with the next release of SonarQube. Hopefully, this moves us a bit closer to being able to do so on SonarCloud. You can vote for the same feature on SonarCloud here.

Thanks Colin