Skip to main content
POST
/
api
/
projects
/
{projectId}
/
branches
/
{branchId}
/
rebase
Rebase branch
curl --request POST \
  --url https://api.example.com/api/projects/{projectId}/branches/{branchId}/rebase \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "resolutions": [
    {
      "path": "<string>",
      "resolution": "useLeft",
      "content": "<unknown>",
      "hash": "<string>"
    }
  ]
}
'
{
  "success": true,
  "newBaseCommitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "message": "<string>",
  "newCommitId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "stats": {
    "filesChanged": 123,
    "conflictsResolved": 123
  }
}

Authorizations

Authorization
string
header
required

Personal access token is obtained through your profile

Path Parameters

projectId
string<uuid>
required

Project ID

branchId
required

Branch ID or "main" for the default branch

Body

application/json
resolutions
object[]

Conflict resolutions for rebasing

Response

200 - application/json

Rebase result

Rebase result

success
boolean
required

Whether the rebase was successful

newBaseCommitId
string<uuid>
required

ID of the new base commit

message
string
required

Human-readable result message

newCommitId
string<uuid>

ID of the new commit created by rebase

stats
object

Rebase statistics