Switch config to an existing branch
git_git_checkout_branchSwitch the Home Assistant config repository to an existing branch, updating live /config files to that branch's committed version. Use to load prepared branch-based 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_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.
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 | |||