Skip to navigation

Rebase a branch onto main

Pull changes from a source branch (defaults to main) into this branch as a new version. If both branches changed the same field, the rebase returns 409 unless conflict_resolutions settles every conflict the rebase preview reports. Callers with only propose access can pull into their own branch from its parent branch (their default source).

Path parameters

agent_idstringRequired
The id of an agent. This is returned on agent creation.
branch_idstringRequired
Unique identifier for the source branch to merge from.

Headers

xi-api-keystringOptional

Query parameters

source_branch_idstring or nullOptional
The ID of the branch to pull changes from. Defaults to the agent's main branch.

Request

This endpoint expects an object.
conflict_resolutionslist of objects or nullOptional

Side to keep, or custom text where the conflict accepts it, for each conflict the preview reported. A merge or rebase with conflicts is rejected unless there is one for every conflict, sent with both tip ids. On a merge it can’t be combined with force, which lets the source win every conflict instead.

branch_tip_idstring or nullOptional

Tip version of the branch being rebased (source_tip_version_id of the rebase preview) the conflicts were resolved against. The request fails with 409 if it moved since.

source_tip_idstring or nullOptional

Tip version of the branch the changes are pulled from (source_branch_id, the main branch by default; target_tip_version_id of the rebase preview) the conflicts were resolved against. The request fails with 409 if it moved since.

Response

Successful Response

Errors

422
Unprocessable Entity Error