Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Setting the main branch via REST API

v-hleb.v March 18, 2021

I'm creating repositories in BitBucket Cloud and I'm looking for a way to configure the main branch. If I use a simple request as in API documentation in response I see "mainbranch": null. I tried to add a mainbranch parameter to the request body but it's ignored. Actually it looks like any unsupported parameter is ignored.

 

So the question is how to configure the main branch via API?

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 22, 2021

Hi @v-hleb.v ,

I'm afraid that it is not possible to configure the main branch of a repo via API.

We have a feature request for supporting the main branch update via API (with the PUT method) for existing repos:

I went ahead and created an additional one for setting up the main branch on repo creation (with the POST method) as well:

I would suggest that you add your vote in the feature requests (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for new features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy here and any updates will be posted in the feature requests.

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events