The name of the branch that the new commit should be created on. When
omitted, the commit will be created on top of the main branch and will become
the main branch's new HEAD/tip.
When a branch name is provided that already exists in the repo, then the
commit will be created on top of that branch. In this case, *if* a parent
SHA1 was also provided, then it is asserted that the parent is the branch's
tip/HEAD at the time the request is made. When this is not the case, a 409
is returned.
This API cannot be used to create new anonymous heads in Mercurial repos.
When a new branch name is specified (that does not already exist in the
repo), and no parent SHA1s are provided, then the new commit will inherit
from the current main branch's tip/HEAD commit, but not advance the main
branch. The new commit will be the new branch. When the request *also*
specifies a parent SHA1, then the new commit and branch branch are created
directly on top of the parent commit, regardless of the state of the main
branch.
When a branch name is not specified, but a parent SHA1 is provided, then
Bitbucket asserts that it represents the main branch's current HEAD/tip, or
a 409 is returned.
When a branch name is not specified and the repo is empty, the new commit
will become the repo's root commit and will be on the main branch.
When a branch name is specified and the repo is empty, the new commit will
become the repo's root commit and also define the repo's main branch going
forward.
This API cannot be used to create additional root commits in non-empty
repos.
The branch field cannot be repeated.
As a side effect, this API can be used to create a new branch without
modifying any files, by specifying a new branch name in this field,
together with `parents`, but omitting the `files` fields, while not sending
any files. This will create a new commit and branch with the same contents as
the first parent. The diff of this commit against its first parent will be
empty.
api throwing an error with 500 status