Change main branch on Bitbucket Pipelines?

Hi all,

I’m setting up our Bitbucket Integration on a project that: 1. is a monorepo; 2. uses “develop” as our main branch.

The current status is that we have the monorepo setup with multiple projects showing up on the SonarCloud dashboard and analyses (of feature branches) appearing just fine. However, on all projects, the “Main branch” is incorrectly set to “master”. I would like to set this to “develop”. How can I achieve this?

I saw several messages saying to delete “develop” and renaming “master” to “develop”, but I see no “Manage branches” option (although i’m an admin on the organisation)

Any help would be greatly appreciated,
Thank you

Hey there.

  • While you may be an organization admin, that doesn’t necessarily make you a project administrator for a given project. If you don’t have admin access, you can restore that access in the organization-level Administration > Projects Management (and open the gear menu next to your project). You probably also want to review your permission templates if you want to have access by default.
  • Is develop in fact set as your main branch in Bitbucket Cloud (under Repository Details > Advanced)?

Hey Colin, thanks again for your replies!

  1. That did it, I now see many more options at the project-level!
  2. Yes, it is, although I had to do the delete and rename for it to pick it up.

SonarCloud now picks up the main branch correctly, but I still need to configure the New Code, so that scans during PRs actually make sense. Do we absolutely need to track versions of the project, or would using build numbers as “versions” work as well?

Thanks a lot for your help!

Great question.

Using a New Code Period of Previous Version and updating the version with each build will mean that your New Code will only ever be defined as “code introduced since the last build”, which we don’t think is particularly meaningful.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.