Start FreeLog in
SonarQube Cloud | Administering SonarQube Cloud | Performing global analysis setup | Setting long-lived branch pattern

Setting the long-lived branches name pattern at the organization level

On this page

This feature is only available in the Enterprise plan.

The long-lived branch name pattern can be set at the organization level for an Enterprise plan organization: it's the pattern that applies by default to all projects. If the project admin sets a custom pattern for their project, this pattern overrides the organization’s pattern. 

Introduction to the long-lived branches name pattern

SonarQube Cloud considers a branch to be long-lived if:

  • It is the main branch, or
  • Its name matches the long-lived branch name pattern.

All other branches are considered short-lived. 

The name pattern is based on a regular expression. For example, the regular expression (branch|release)-.*  matches any branch name that begins with the string branch- or release-

If you don't set any pattern at the organization level, the default pattern (branch|release)-.* applies. You can reset the organization pattern to this value.

Setting a long-lived branches pattern for your organization

You must be an organization admin to be able to perform this procedure.

To set the long-lived branches pattern of your organization:

  1. Retrieve the organization.
  2. Go to Administration > Organization settings.
  3. In Branch > Long-lived branches detection, enter your regular expression. 
  4. Select Save.

Resetting the organization-level pattern to its default

  1. Retrieve the organization.
  2. Go to Administration > Organization settings.
  3. In Branch > Long-lived branches detection, select reset. The pattern is reset to (branch|release)-.*.

Was this page helpful?

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License