Skip to main content
GET
/
api
/
projects
/
{projectId}
/
branches
/
{branchId}
/
merge-preview
Get merge preview
curl --request GET \
  --url https://api.example.com/api/projects/{projectId}/branches/{branchId}/merge-preview \
  --header 'Authorization: Bearer <token>'
{
  "canMerge": true,
  "isUpToDate": true,
  "needsRebase": true,
  "changes": [
    {
      "type": "added",
      "file": "<unknown>",
      "from": "<unknown>",
      "to": "<unknown>"
    }
  ],
  "conflicts": [
    {
      "reason": "modify/modify",
      "path": "<string>",
      "base": "<unknown>",
      "ours": "<unknown>",
      "theirs": "<unknown>",
      "deleted": "ours",
      "modified": "<unknown>"
    }
  ],
  "stats": {
    "filesAdded": 123,
    "filesDeleted": 123,
    "filesModified": 123,
    "totalChanges": 123,
    "filesRenamed": 123
  },
  "message": "<string>"
}

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

Response

200 - application/json

Merge preview result

Merge preview result

canMerge
boolean
required

Whether the branch can be merged without conflicts

isUpToDate
boolean
required

Whether the branch is up to date with main

needsRebase
boolean
required

Whether the branch needs to be rebased

changes
object[]
required

List of file changes that would result from merge

conflicts
object[]
required

List of merge conflicts

stats
object
required

Change statistics

message
string
required

Human-readable merge status message