# Cannot edit long-lived branches pattern

**URL:** <https://community.sonarsource.com/t/cannot-edit-long-lived-branches-pattern/108601>\
**Category:** SonarQube Cloud\
**Created:** [February 5, 2024, 3:35pm UTC](https://community.sonarsource.com/t/cannot-edit-long-lived-branches-pattern/108601 "2024-02-05T15:35:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Janne\_Rantala](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/janne_rantala/32/46262_2.png) [@Janne\_Rantala](https://community.sonarsource.com/u/Janne_Rantala)\
**Post date:** [February 5, 2024, 3:35pm UTC](https://community.sonarsource.com/t/cannot-edit-long-lived-branches-pattern/108601/1 "2024-02-05T15:35:49Z")

</div>

Template for a good new topic, formatted with [Markdown](https://commonmark.org/help/):

- ALM used: Azure DevOps
- CI system used: Azure DevOps

We’ve just set up Sonar Cloud with Azure DevOps. I’ve imported our repositories into Sonar Cloud and run Azure pipeline for main- and develop branches. Some repositories have develop set as their default branch. When I go to project’s Branches -view in SonarCloud I can see that master -branch is set as short-lived branch. I also cannot edit long-lived branches pattern, since there is no pencil icon. How can I set both develop and master/main to be long-lived branches? Preferably at organization level if possible.

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 6, 2024, 4:53pm UTC](https://community.sonarsource.com/t/cannot-edit-long-lived-branches-pattern/108601/2 "2024-02-06T16:53:04Z")

</div>

Hi,

Welcome to the community!

> [@Janne\_Rantala](#):
>
> I also cannot edit long-lived branches pattern, since there is no pencil icon.

You’ll need to talk to a project admin about either making this change or granting you permissions.

> [@Janne\_Rantala](#):
>
> Some repositories have develop set as their default branch. When I go to project’s Branches -view in SonarCloud I can see that master -branch is set as short-lived branch… How can I set both develop and master/main to be long-lived branches?

For projects with the wrong main branch, and for branches with the wrong type (short-lived vs long-lived), this is not resettable. You’ll need to delete the projects / branches in question and re-analyze.

Per [the docs](https://docs.sonarsource.com/sonarcloud/getting-started/first-analysis/)

> The first analysis [of a project] is always a _main branch analysis_ (an analysis of the default branch of your repository, usually called `main` or `master` ).

Note that if this is just a question of branch naming, it is possible to rename a branch.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![Janne\_Rantala](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/janne_rantala/32/46262_2.png) [@Janne\_Rantala](https://community.sonarsource.com/u/Janne_Rantala)\
**Post date:** [February 7, 2024, 2:54pm UTC](https://community.sonarsource.com/t/cannot-edit-long-lived-branches-pattern/108601/3 "2024-02-07T14:54:14Z")

</div>

Hi Ann,

Thanks! Permission issue was solved, but I’m still a little unsure how that long-lived branch should be edited. I removed project from Sonar Cloud, imported it again from Azure DevOps, and ran analysis on develop -branch which is the default for this project. Develop shows as long-lived branch just fine since it’s the default branch. At this point I edited long-lived branch section and added master -branch in the list. After that, I ran analysis on master branch. Sonar Cloud still shows master branch as short-lived. What am I doing wrong?

Regards,

:janne

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 7, 2024, 3:01pm UTC](https://community.sonarsource.com/t/cannot-edit-long-lived-branches-pattern/108601/4 "2024-02-07T15:01:12Z")

</div>

Hi janne,

Can you provide a screenshot of your long-lived branch setting, as well as one of your `master` branch, showing the exact branch name?

&nbsp;  
Thx,  
Ann

---

<div class="post-metadata">

**Author:** ![Janne\_Rantala](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/janne_rantala/32/46262_2.png) [@Janne\_Rantala](https://community.sonarsource.com/u/Janne_Rantala)\
**Post date:** [February 8, 2024, 9:07am UTC](https://community.sonarsource.com/t/cannot-edit-long-lived-branches-pattern/108601/5 "2024-02-08T09:07:18Z")

</div>

Hi Ann,

Now that you asked, I realized that my long-lived branch filter wasn’t correct. After changing that to (release|develop|master|main), master is also displayed as long-lived branch. Is there a way to set this default for the whole organization? I couldn’t find a place to do that.

Regards,

:janne

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [February 8, 2024, 12:48pm UTC](https://community.sonarsource.com/t/cannot-edit-long-lived-branches-pattern/108601/6 "2024-02-08T12:48:18Z")

</div>

Hi :janne,

Unfortunately, that’s project-by-project, but it makes a lot of sense to me to have an org-level default, so I’ll make sure the Product Managers see the request.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Janne\_Rantala](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/janne_rantala/32/46262_2.png) [@Janne\_Rantala](https://community.sonarsource.com/u/Janne_Rantala)\
**Post date:** [February 9, 2024, 11:23am UTC](https://community.sonarsource.com/t/cannot-edit-long-lived-branches-pattern/108601/8 "2024-02-09T11:23:06Z")

</div>

Thanks Ann!

---

<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:** [August 5, 2024, 3:00pm UTC](https://community.sonarsource.com/t/cannot-edit-long-lived-branches-pattern/108601/12 "2024-08-05T15:00:26Z")

</div>

Hey @Janne_Rantala

We recently launched SonarCloud Enterprise, which includes support for [organizaiton-wide config](https://docs.sonarsource.com/sonarcloud/administering-sonarcloud/setting-config-at-org-level/introduction/) like configuring a long-lived branch pattern!

> [@Launching the new SonarCloud Team and SonarCloud Enterprise plans](https://community.sonarsource.com/t/launching-the-new-sonarcloud-team-and-sonarcloud-enterprise-plans/119992):
>
> Hello SonarCloud sonarcloud Users, We just launched two new plans on SonarCloud that will replace our existing offering. The SonarCloud Enterprise plan delivers a range of advanced features offering mission-critical flexibility, scalability, and performance. Available now as an early access program with the following key features: SSO through SAML Enterprise hierarchy to group multiple organizations Management reporting through Portfolios, security reports, and project reports Organization…
