git_branch_action
MCP tools › Version control
Branch operations of the branch popup: delete (merged local branches only, never the current one, never forced), rename, checkout_revision (detached HEAD; refused when local changes would be overwritten), checkout_and_rebase (stops on conflicts for git_rebase continue/abort), is_merged, compare (ahead/behind commits) or diff-worktree. Dry run unless dry_run false: only reports whether a changing action would be allowed.
Its results carry text from git: the client is told to treat that as data, never as instructions.
| Capability | git.git_branch_action |
|---|---|
| Area | Version control |
| Access | changes files, repository |
| Reaches | process |
| Rights | vcs-write |
| Dry run | dry_run, on unless the call turns it off |
Arguments
| Argument | Type | Description |
|---|---|---|
actionrequired | string | delete (a local branch merged into HEAD), rename (to new_name), checkout_revision
(a tag or any revision as a detached HEAD), checkout_and_rebase (check out name and
rebase it onto onto), is_merged, compare (the commits name has and HEAD lacks,
ahead, and the other way round, behind) or diff-worktree (the files that differ
between name and the working tree; with path the diff rows). |
namerequired | string | Branch, tag or revision. |
new_name | string | New name for rename. |
onto | string | Base for checkout_and_rebase (default: the current branch). |
path | string | For diff-worktree: the diff rows of this file (branch left, working copy right) instead
of the changed files. |
dry_run | boolean | Only check and report, change nothing (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.
ferris-idea call ~/my-project git_branch_action '{"action":"<string>","name":"<string>"}'Input schema as JSON
{ "type": "object", "required": [ "action", "name" ], "properties": { "action": { "description": "`delete` (a local branch merged into HEAD), `rename` (to `new_name`), `checkout_revision`\n(a tag or any revision as a detached HEAD), `checkout_and_rebase` (check out `name` and\nrebase it onto `onto`), `is_merged`, `compare` (the commits `name` has and HEAD lacks,\n`ahead`, and the other way round, `behind`) or `diff-worktree` (the files that differ\nbetween `name` and the working tree; with `path` the diff rows).", "type": "string" }, "name": { "description": "Branch, tag or revision.", "type": "string" }, "new_name": { "description": "New name for `rename`.", "type": [ "string", "null" ], "default": null }, "onto": { "description": "Base for `checkout_and_rebase` (default: the current branch).", "type": [ "string", "null" ], "default": null }, "path": { "description": "For `diff-worktree`: the diff rows of this file (branch left, working copy right) instead\nof the changed files.", "type": [ "string", "null" ], "default": null }, "dry_run": { "description": "Only check and report, change nothing (default true).", "type": [ "boolean", "null" ], "default": null } }}