Checkout New Git Branch always uses current branch as starting point

I'm using API explorer to create a POC for some API development.

Step 2 of this process is to create a new branch based off master, essentially doing this, but through the API:

benatdaasity_0-1726528311163.png

I'm trying to do that with an sdk call like the following:

response = sdk.create_git_branch(
    project_id="my_project_name",
    body=mdls.WriteGitBranch(
        name="my_new_branch_name",
        ref="master"
    ))

However I've tested this about a dozen times now, and every time the new branch is created using the HEAD of the current branch rather than the master branch. 

It'd be fine if there was a way to reset the branch to production after creating it, (similar to the "Pull from Production" action in the UI), but I don't see a way to just reset that branch via the API.

Can anyone help? Just this just not work as documented, or am I doing something wrong?

0 3 553
3 REPLIES 3