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

Apurva Sharma July 31, 2017

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?

2 answers

2 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 4, 2017

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!

Ana

Apurva Sharma August 4, 2017

Thanks Ana. It works.

Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 9, 2017

Glad I could help you, Apurva :) 

gur_singh May 14, 2018

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

gur_singh May 14, 2018

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

1 vote
alex carreño March 31, 2020

Can you put an example of how you did the http post?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events