Adjusting various project settings
This page is directed at the project admin.
Defining the long-lived branch name pattern at project level
SonarCloud 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 type of a branch (long-lived or short-lived) is set during its first analysis and cannot be changed afterward.
If your project belongs to an Enterprise plan organization, its long-lived branch name pattern is by default the pattern set at the organization level. You can change it.
The name pattern is based on a regular expression. For example, the regular expression: (branch|release)-.*
matches any name that begins with the string branch-
or release-
.
Changing the long-lived branch pattern of your project
- Retrieve the project.
- In the left navigation bar, select Branches.
- In the top-right corner, select the edit icon on the right of Long-lived branches pattern. The Detection of long-lived branches dialog opens as illustrated below (in the case of an enterprise plan organization).
- Enter your regular expression.
- Select Save.
![](https://assets-eu-01.kc-usercontent.com:443/5e986e54-339c-01a9-7c7c-26cbc5a344d5/1425bc04-0402-482a-8839-35df0764d671/sonarcloud-project-long-lived-branch-detection-pattern_Cs0010.png?w=1016&h=611&auto=format&fit=crop)
Resetting the long-lived branch pattern to default
If your project belongs to an Enterprise plan organization, you may want to reset the long-lived branch to the default set at the organization level. To do so:
- Retrieve the project.
- In the left navigation bar, select Branches.
- In the top-right corner, select the edit icon on the right of Long-lived branches pattern. The Detection of long-lived branches dialog opens.
- Select Reset to default.
Changing the project key
- Retrieve the project.
- In the left sidebar, select Administration > Update Key. The Update Key page opens.
- Enter the new key and select Update.
Changing the project's visibility
The project's visibility may be:
- Public: Anyone, including anonymous users, can view public projects. A public project may be part of a free or paid plan organization.
- Or private: Only authorized users, who are members of the organization, can view a private project. A private project can only be part of a paid plan organization.
If your organization is a paid plan organization then you can change the visibility of your project provided you're a project admin. Otherwise, you must upgrade your organization to the paid plan.
To change the visibility of your project:
- Retrieve the project.
- In the left sidebar, select Administration > Permissions. The Permissions page opens.
- In the Project visibility section, select the Public or Private checkbox (Or you can upgrade your organization from this section.) The Turn to Private / Public dialog opens.
- Confirm the change.
Adding links on the project Information page
You can add URLs associated with your project visible on your project’s Information page in the External Links section.
Creating a project link
- Retrieve the project.
- In the left sidebar, select Administration > Links. The Links page opens.
- In the top right corner, select Create. The Create New Project Link dialog opens.
- Enter the name and URL, and select Create.
Deleting a project link
- Retrieve the project.
- In the left sidebar, select Administration > Links. The Links page opens with the list of configured links.
- Select the dustbin icon in the row of the link to delete.
Changing the binding of your project
You can bind a project to another repository or you can bind an unbound project to a repository.
Binding a project to another repository
You can change the repository binding of a project provided you have Administer permission on that project and Create projects permission. The following limitations apply:
- The source and target repositories must be in the same organization.
- A public project cannot be bound to a private repository.
The repository change will not impact the automatic analysis activation status of your project except if the target repository is a monorepo and automatic analysis was enabled for your project. In that case, the automatic analysis will be disabled since it's not supported for monorepos and you will need to manually configure a CI-based analysis for your project.
Changing the binding of a project configured with a CI-based analysis may require that you change the CI/CD process configuration for this project.
To bind a project to another repository:
- Retrieve the project.
- Go to Administration > General Settings > Repository binding.
- In the list of repositories, select the target repository and click Save.
Binding an unbound project to a repository
You can bind an unbound project to a repository provided you have Administer permission on that project and Create project permission. Note that a public project cannot be bound to a private repository.
In case you had manually linked your project to a repository, you should remove this manual setup.
To bind an unbound project to a repository:
- Retrieve the project.
- Go to Administration > General Settings > Repository binding.
- In the list of repositories, select the repository and click Save.
You may want to enable the automatic analysis on your newly bound project. To do so, see Activating automatic analysis.
Updating the project binding on repository URL change
In case you renamed your repository or moved it within the same organization, you can update the repository binding to your SonarCloud project as follows:
- Retrieve the project.
- Go to Administration > General Settings > Repository binding.
- In the list of repositories, re-select the target repository and click Save.
Disabling the automatic analysis
If applicable, a new project's analysis method is set to automatic analysis by default.
To disable the automatic analysis on your project:
- Retrieve the project.
- Go to Administration > Analysis method.
- In Automatic Analysis, unselect Enabled for this project.
With the Enterprise plan, you can disable the automatic analysis for all new projects in your organization.
Was this page helpful?