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

Cannot create branch via bitbucket API 2.0

Karthikraj November 15, 2022

@Caroline R ,

 

How define the "target - hash" for newly created respository ? I try to do it default

{
'name': 'develop',
'target': {'hash': 'default'},
}

But its shows error

{"type": "error", "error": {"message": "Bad request", "fields": {"target.hash": "Commit not found: default"}}}

Can you please guide me to do the same.

Thanks & Regards

Karthikraj M.

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 7, 2022

Hi @Karthikraj,

If you are using the following endpoint, the hash needs to be a commit hash or a branch name:

Is the newly created repo empty? If so, it will not be possible to create a new branch with this API endpoint, as there are no commits on the repo yet. The repo needs to have at least one commit in order to be able to create a new branch.

Just a heads up, I moved your post to a new question; it's best to create a new question if you need assistance, as an existing one can be difficult to follow and monitor if we try to troubleshoot multiple users' issues.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events