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>"
}Previews the result of merging a branch into main, including any conflicts.
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>"
}Personal access token is obtained through your profile
Project ID
Branch ID or "main" for the default branch
Merge preview result
Merge preview result
Whether the branch can be merged without conflicts
Whether the branch is up to date with main
Whether the branch needs to be rebased
List of file changes that would result from merge
Show child attributes
List of merge conflicts
Show child attributes
Change statistics
Show child attributes
Human-readable merge status message
Was this page helpful?