Create and switch to a new git branch
git_create_branchCreate a new Git branch from the current commit and switch to it, carrying uncommitted changes so you can isolate work without changing existing branch history.
Instructions
Create a new git branch from the current commit and switch to it.
Calls repo.create_head(branch_name) then branch.checkout();
uncommitted changes carry over onto the new branch, and live /config
files now follow it.
Use when: starting an isolated set of changes without touching the
current branch's commit history.
Not for: switching to a branch that already exists — use
git_checkout_branch.
Returns: dict {"status": "created_and_checked_out", "branch": ...}.
Errors: raises an exception from gitpython when a branch named
branch_name already exists; raises RuntimeError (from _repo())
when no git repo exists.
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": {
"branch_name": "<branch_name>"
},
"name": "git_create_branch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch_name | Yes | Name of the new git branch to create, e.g. 'automation-refactor'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||