Create a branch
create_branchCreates a new branch in a Forgejo, Codeberg, or Gitea repository, optionally from an existing branch, tag, or commit, so you can isolate work or prepare changes.
Instructions
Create a branch in a repository (owner/repo/new_branch, optional old_ref; requires write mode). Answers with the branch in list_branches' shape: name, head commit and protection.
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": "<new_branch>"
},
"name": "create_branch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Repository name. | |
| owner | Yes | Repository owner. | |
| old_ref | No | Existing branch, tag, or commit to branch from. Defaults to the repo's default branch. | |
| new_branch | Yes | Name for the new branch. |