Create and switch to a new git branch
git_git_create_branchCreate and switch to a new git branch from the current commit, preserving uncommitted changes while isolating work from current branch history. Use only for new branch names.
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_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.
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 | |||