Create branch from exact commit
gh_create_branch_from_shaCreate a new branch at an exact commit SHA without overwriting existing branches. Verifies the ref after creation, leaving conflicts unchanged.
Instructions
Additive write: create exactly one new branch at an exact 40-character commit SHA after ordinary write authorization. A branch already at the requested SHA is a safe no-write result; a conflicting existing branch is left unchanged. One mutation attempt is followed by authoritative exact-ref readback; the operation never force-updates, moves, overwrites, deletes, or blindly retries an ambiguous ref creation.
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": {
"owner": "<owner>",
"repo": "<repo>",
"name": "<name>",
"base_sha": "<base_sha>"
},
"name": "gh_create_branch_from_sha"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | New branch name. | |
| repo | Yes | GitHub repository name without the owner prefix. | |
| owner | Yes | GitHub repository owner or organization login. | |
| base_sha | Yes | Exact commit SHA at which to create the new branch. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | ||
| name | Yes | ||
| created | Yes | ||
| message | Yes | ||
| warning | No | ||
| base_sha | Yes | ||
| request_id | No | ||
| write_completed | Yes | ||
| readback_completed | Yes | ||
| precondition_checked | Yes | ||
| state_matches_requested | Yes |