跳到导航

将分支合并到目标分支

Merge a branch into a target branch. If both branches changed the same field, the merge returns 409 unless conflict_resolutions settles every conflict the merge preview reports, or force is set.

路径参数

agent_idstring必需

智能体 ID。创建智能体时返回此值。

source_branch_idstring必需

要合并的源分支唯一标识符。

请求头

xi-api-keystring可选

查询参数

target_branch_idstring必需

要合并到的目标分支 ID。

请求

This endpoint expects an object.
archive_source_branchboolean可选默认为 true

合并后是否归档源分支

forceboolean可选默认为 false

Keep the source branch’s value for every conflict instead of sending conflict_resolutions

conflict_resolutionslist of objects可选

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.

source_tip_idstring可选

Source branch tip version the conflicts were resolved against (source_tip_version_id of the preview). The request fails with 409 if the branch moved since.

target_tip_idstring可选

Target branch tip version the conflicts were resolved against (target_tip_version_id of the preview). The request fails with 409 if the branch moved since.

响应

成功响应

错误

422
Branches Merge Request Unprocessable Entity Error