Deba
(Deba)
March 13, 2026, 3:08am
1
Template for a good new topic, formatted with Markdown :
ALM used (GitLab)
CI system used (Gitlab runner)
Pipeline generated
Languages of the repository
Only if the SonarCloud project is public, the URL
And if you need help with pull request decoration, then the URL to the PR too
I am unable to change the Long-Lasting branch name
Steps to reproduce
I created a project and added my GitLab repo after adding the required tokens etc.
Now when my pipeline runs it select the main branch as the Long Lasting Branch.
I tried to edit the regex to (develop_*). but still it picks the main branch as the LongLasting Branch.
I could not find any workaround on this.
I have admin rights but cant still change the default branch
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
ganncamp
(G Ann Campbell)
March 16, 2026, 1:41pm
2
Hi,
Welcome to the community!
There is no ability to change which branch is the main branch on SonarQube Cloud.
Ann
Deba
(Deba)
March 17, 2026, 2:24pm
4
So how do I get the long lasting branch assigned as I cannot get the different analysis like new code etc.
ganncamp
(G Ann Campbell)
March 17, 2026, 2:30pm
5
Hi,
I don’t understand the question. If you need to change which branch is seen as ‘main’ you have 2 options:
nuclear: delete the project and start over, with the loss of all history
disjoint: rename the current main branch to the name of the desired main and delete the current branch with that name. Again, there’s a history loss, but less catastrophic.
HTH,
Ann
Deba
(Deba)
March 18, 2026, 3:05pm
6
Thanks Ann. Renaming the main branch worked. Thank you for your help
1 Like