create_branch
Create a new branch in a repository, forking from an existing branch or the default branch. Returns the branch object, or fails if the branch name already exists.
Instructions
Create a new branch in a repository.
Returns the created Gitea Branch object. Fails cleanly via
:class:GiteaAPIError if the new branch name already exists.
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>",
"new_branch_name": "<new_branch_name>"
},
"name": "create_branch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner | |
| repo | Yes | Repository name | |
| new_branch_name | Yes | Name for the new branch (must not already exist) | |
| old_branch_name | No | Existing branch to fork from. Omit to use the repository's default branch. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||