git-mcp-server: Create branch
git_switch_createCreate and switch to a new local branch from an exact expected branch and HEAD, rejecting any mismatch or dirty state.
Instructions
Operation: Create and switch to one new branch from the exact expected_branch and exact expected HEAD. Returns: request_id, repository_id, the created branch, and unchanged head; no session identifier. Defaults: a string expected_branch requires that attached branch, while null requires detached HEAD. Excludes: existing branch checkout, force or reset, branch or HEAD mismatch, dirty or untracked state, and remote access.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | Yes | New local branch name to create from the exact expected HEAD; existing or invalid refs are rejected. | |
| repository | Yes | Absolute path to the exact target Git worktree for this mutation. | |
| request_id | Yes | Client-generated UUID that makes this mutation durable and idempotent for exact replay. | |
| expected_head | Yes | Exact current local HEAD object ID expected before mutation; mismatch rejects without Git mutation. | |
| expected_branch | Yes | Exact current local branch expected before branch creation, or null to require detached HEAD; mismatch rejects without Git mutation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| error | No | ||
| status | Yes | ||
| warnings | Yes | ||
| operation | Yes | ||
| request_id | No | ||
| repository_id | No | ||
| observed_after | No | ||
| observed_before | No |