Reference

Reset branch

Makes the branch's files what they were at a commit, as one new commit.

POST
/namespaces/{namespace}/branches/{branch}/reset

The history stays: the new commit is on top of the head. The commit may be from any branch of the namespace.

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

namespace*string

A namespace of your organization, such as prod/app, or <org>:<namespace> for a public namespace of another one. Encode / as %2F.

branch*string

A branch, such as main or agents/fix-1. Encode / as %2F.

Request Body

application/json
  1. body
to*string

The commit whose files the branch should have.

Match^[0-9a-f]{64}$
message?string
Length1 <= length <= 10000

Response Body

The files already match, so no commit was made.

application/json
  1. response
head*string

The branch's head after the call.

changed*boolean

False when every change matched what was already there. Then no commit is made and head is the current one.

Example Request
curl -X POST 'https://example.com/v1/namespaces/string/branches/string/reset' \  -H 'Content-Type: application/json' \  -d '{  "to": "string"}'
Example Response
{  "head": "string",  "changed": true}