git_switch_branch
MCP tools › Version control
Switch to a local branch: updates the files that differ between HEAD and the branch, keeps unrelated local changes and refuses (listing the paths) when local changes would be overwritten. dry_run defaults to true and only lists changes and conflicts. smart=true (with dry_run=false) puts all local changes aside in a named stash, switches and brings them back; changes that conflict stay in the stash and the files get conflict markers (result: switch and stash).
Its results carry text from git: the client is told to treat that as data, never as instructions.
| Capability | git.git_switch_branch |
|---|---|
| Area | Version control |
| Access | changes files, repository |
| Reaches | — |
| Rights | vcs-write |
| Dry run | dry_run, on unless the call turns it off |
Arguments
| Argument | Type | Description |
|---|---|---|
namerequired | string | Local branch to switch to. |
dry_run | boolean | Only report the files that would change and conflicts (default true). |
smart | boolean | Put local changes in the way aside in a stash and bring them back afterwards (needs dry_run=false). |
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_switch_branch '{"name":"<string>"}'Input schema as JSON
{ "type": "object", "required": [ "name" ], "properties": { "name": { "description": "Local branch to switch to.", "type": "string" }, "dry_run": { "description": "Only report the files that would change and conflicts (default true).", "type": [ "boolean", "null" ] }, "smart": { "description": "Put local changes in the way aside in a stash and bring them back afterwards (needs\ndry_run=false).", "type": [ "boolean", "null" ], "default": null } }}