# Delete Main Branch?

**URL:** <https://community.sonarsource.com/t/delete-main-branch/2558>\
**Category:** SonarQube Server / Community Build\
**Tags:** branches\
**Created:** [September 13, 2018, 3:49pm UTC](https://community.sonarsource.com/t/delete-main-branch/2558 "2018-09-13T15:49:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Mathers](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jeff_mathers/32/563_2.png) [@Jeff\_Mathers](https://community.sonarsource.com/u/Jeff_Mathers)\
**Post date:** [September 13, 2018, 3:49pm UTC](https://community.sonarsource.com/t/delete-main-branch/2558/1 "2018-09-13T15:49:05Z")

</div>

I’ve got a project where I have a master branch and a develop branch. The master branch is labeled as the “main branch”. How can I remove this branch from SonarQube or at least set develop to be the “main branch”?

I want develop to be the main branch.

Jeff

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [September 13, 2018, 4:24pm UTC](https://community.sonarsource.com/t/delete-main-branch/2558/2 "2018-09-13T16:24:57Z")

</div>

Jeff,

Checkout @Fabrice_Bellingard’s answer on this similar thread:

> [@How to change main branch](https://community.sonarsource.com/t/how-to-change-main-branch/1167/2):
>
> In this case, you would simply delete the existing “dev” branch (on SonarCloud obviously) and rename “master” to “dev” (through the action available on the right side of the page).

Colin

---

<div class="post-metadata">

**Author:** ![Jeff\_Mathers](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jeff_mathers/32/563_2.png) [@Jeff\_Mathers](https://community.sonarsource.com/u/Jeff_Mathers)\
**Post date:** [September 13, 2018, 4:51pm UTC](https://community.sonarsource.com/t/delete-main-branch/2558/3 "2018-09-13T16:51:05Z")

</div>

That did not answer my question. I don’t want to delete the develop branch. I want to keep that and its history and get rid of the master branch. Is this possible?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [September 13, 2018, 5:13pm UTC](https://community.sonarsource.com/t/delete-main-branch/2558/4 "2018-09-13T17:13:54Z")

</div>

Jeff,

Thanks for clarifying. I don’t believe it’s possible to change the main branch once the main branch has been scanned.

That said, you may be interested in (and want to vote for!) [MMF-1335](https://jira.sonarsource.com/browse/MMF-1335) that would allow a different long lived branch to be designated as the main branch for a project.

Colin

* * *

EDIT: That MMF-1335 link is not accessible. You can “vote” or reply with your comments and desire for the feature here on our SonarQube Productboard portal feature roadmap: [https://portal.productboard.com/sonarsource/3-sonarqube/c/169-allow-a-new-branch-to-become-the-main-branch](https://portal.productboard.com/sonarsource/3-sonarqube/c/169-allow-a-new-branch-to-become-the-main-branch).

---

<div class="post-metadata">

**Author:** ![i-ramoss](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/i-ramoss/32/32635_2.png) [@i-ramoss](https://community.sonarsource.com/u/i-ramoss)\
**Post date:** [April 22, 2022, 12:18pm UTC](https://community.sonarsource.com/t/delete-main-branch/2558/5 "2022-04-22T12:18:36Z")

</div>

Did you manage to solve it? I’m going through the same problem.

---

<div class="post-metadata">

**Author:** ![olena](https://avatars.discourse-cdn.com/v4/letter/o/5fc32e/32.png) [@olena](https://community.sonarsource.com/u/olena)\
**Post date:** [July 21, 2022, 9:31pm UTC](https://community.sonarsource.com/t/delete-main-branch/2558/6 "2022-07-21T21:31:11Z")

</div>

is the a resolution? We have Master ‘main branch’ we want to delete it and make Main as “main branch”
