Create a branch
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Owner of the repo
Name of the repo
Request Body
Section titled “Request Body”CreateBranchRepoOption options when creating a branch in a repository
object
Name of the branch to create
Deprecated: true Name of the old branch to create from
Name of the old branch/tag/commit to create from
Examplegenerated
{ "new_branch_name": "example", "old_branch_name": "example", "old_ref_name": "example"}Responses
Section titled “Responses”Branch
Branch represents a repository branch
object
PayloadCommit represents a commit
object
PayloadUser represents the author or committer of a commit
object
Full name of the commit author
PayloadUser represents the author or committer of a commit
object
Full name of the commit author
Sha1 hash of the commit
PayloadCommitVerification represents the GPG verification of a commit
object
PayloadUser represents the author or committer of a commit
object
Full name of the commit author
Examplegenerated
{ "commit": { "added": [ "example" ], "author": { "email": "hello@example.com", "name": "example", "username": "example" }, "committer": { "email": "hello@example.com", "name": "example", "username": "example" }, "id": "example", "message": "example", "modified": [ "example" ], "removed": [ "example" ], "timestamp": "2026-04-15T12:00:00Z", "url": "example", "verification": { "payload": "example", "reason": "example", "signature": "example", "signer": { "email": "hello@example.com", "name": "example", "username": "example" }, "verified": true } }, "effective_branch_protection_name": "example", "enable_status_check": true, "name": "example", "protected": true, "required_approvals": 1, "status_check_contexts": [ "example" ], "user_can_merge": true, "user_can_push": true}The branch is archived or a mirror.
The old branch does not exist.
The branch with the same name already exists.
QuotaExceeded
Headers
Section titled “Headers”APIRepoArchivedError is an error that is raised when an archived repo should be modified
object
Examplegenerated
{ "message": "example", "url": "example"}