Bitbucket REST API: How to create a new commit on a specific branch?

I am using scr POST request to upload/overwrite a file on my Bitbucket repo. This request always executes on a master branch. I would like to specify the branch name in my request. Is that something Bitbucket REST API supports?

1 answer

2 votes

Hi Apurva, in the Cloud REST API documentation you'll find it's possible to add the name of the branch that the new commit should be created on. You'll find it in the Query parameters section when you scroll down the page. 

 Hope that helps!


Thanks Ana. It works.

Glad I could help you, Apurva :) 

api throwing an error - status code 500 ..msg- Something went wrong

api throwing an error with status 500, msg- Something went wrong

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

434 views 6 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you