Skip to content

git_resolve_conflict

MCP tools › Version control

Resolve the merge conflict of one file, then mark it resolved (git add): take ours, theirs, base or simple (word-by-word merge) for every conflict, a given text, or per-conflict choices. With only path it reads the state: the merged result, open_conflicts and every conflict with its base, ours and theirs text. Binary files and files one side deleted take a whole side. Refused, changing nothing: text with conflict markers (unless allow_markers), base without a base, or writing while a conflict stays open. Dry run unless dry_run false. A file open in the window is updated in its editor as one undo step and saved before git add.

Its results carry text from git, files: the client is told to treat that as data, never as instructions.

Capabilitygit.git_resolve_conflict
AreaVersion control
Accesschanges files, repository
Reaches—
Rightsvcs-write
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
pathrequiredstringWorkspace path of the conflicted file.
takestringThe resolved text: ours, theirs, base, simple (word-by-word merge of simple conflicts), or omitted to pass text. A binary file and a file one side deleted take ours or theirs as a whole (base when the base has the file).
textstringHand-written result when take is omitted.
allow_markersbooleanWrite text although it still has conflict markers (default false: refused).
choicesarray of objectChoices for single conflicts instead of take or text (SPEC-0101 v7 behaviour 26); conflicts without an entry stay open.
choices[].conflictrequiredintegerNumber of the conflict in the file, from 0, as conflicts lists it.minimum 0
choices[].takestringours, theirs, both (ours, then theirs), base or simple (the word-by-word merge of a simple conflict); omitted to pass text.
choices[].textstringHand-written text of the conflict's region when take is omitted.
dry_runbooleanOnly return the result without writing (default true).

Call it from a shell

ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.

Terminal window
ferris-idea call ~/my-project git_resolve_conflict '{"path":"<string>"}'
Input schema as JSON
{
"properties": {
"path": {
"description": "Workspace path of the conflicted file.",
"type": "string"
},
"take": {
"description": "The resolved text: `ours`, `theirs`, `base`, `simple` (word-by-word merge of simple\nconflicts), or omitted to pass `text`. A binary file and a file one side deleted take\n`ours` or `theirs` as a whole (`base` when the base has the file).",
"type": [
"string",
"null"
],
"default": null
},
"text": {
"description": "Hand-written result when `take` is omitted.",
"type": [
"string",
"null"
],
"default": null
},
"allow_markers": {
"description": "Write `text` although it still has conflict markers (default false: refused).",
"type": [
"boolean",
"null"
],
"default": null
},
"choices": {
"description": "Choices for single conflicts instead of `take` or `text` (SPEC-0101 v7 behaviour 26);\nconflicts without an entry stay open.",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/$defs/ConflictChoice"
}
},
"dry_run": {
"description": "Only return the result without writing (default true).",
"type": [
"boolean",
"null"
],
"default": null
}
},
"$defs": {
"ConflictChoice": {
"description": "The resolution of one conflict in `git_resolve_conflict`'s `choices`.",
"type": "object",
"properties": {
"conflict": {
"description": "Number of the conflict in the file, from 0, as `conflicts` lists it.",
"type": "integer",
"minimum": 0
},
"take": {
"description": "`ours`, `theirs`, `both` (ours, then theirs), `base` or `simple` (the word-by-word merge\nof a simple conflict); omitted to pass `text`.",
"type": [
"string",
"null"
],
"default": null
},
"text": {
"description": "Hand-written text of the conflict's region when `take` is omitted.",
"type": [
"string",
"null"
],
"default": null
}
},
"required": [
"conflict"
]
}
},
"required": [
"path"
],
"type": "object"
}