Safely create or switch Git branches
git_switch_branchSwitch to an existing Git branch or create a new one after validating branch name, expected HEAD, and clean working tree.
Instructions
Creates a new branch or switches to an existing branch after validating the branch name, optional expected HEAD, and clean working-tree requirement.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project": "<project>",
"branch": "<branch>"
},
"name": "git_switch_branch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | Yes | ||
| create | No | ||
| dryRun | No | ||
| project | Yes | Project key from list_projects. | |
| expectedHead | No | ||
| requireClean | No |