Switch config to an existing branch
git_checkout_branchSwitch the Home Assistant config git repository to an existing branch, replacing tracked /config files with that branch's committed version. Use it to move between prepared branch configurations.
Instructions
Switch the HA config git repository to an existing branch.
Calls repo.git.checkout(branch_name), which replaces every tracked
file under /config with that branch's committed version — the live
configuration Home Assistant reads from changes as soon as this
returns.
Use when: switching between prepared configurations that are tracked
as branches.
Not for: creating a branch that does not exist yet — use
git_create_branch.
Returns: dict {"status": "switched", "branch": ...}.
Errors: raises an exception from gitpython when branch_name does not
exist, or when uncommitted local changes would conflict with the
target branch's files; raises RuntimeError (from _repo()) when no
git repo exists.
Limits: no confirm parameter; a conflicting uncommitted change blocks
the checkout rather than being silently discarded (plain git
behaviour), but a non-conflicting one carries over onto the new
branch.
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_checkout_branch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch_name | Yes | Name of an existing git branch to switch the config repository to. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||