Skip to content

Public API: Create branch #8213

Closed
Closed

Description

@Meldiron

Describe the feature

Similar to ability to List branches which shows branch name and commit details, let's have Create branch, to have better feature parity with industry standard.

This is pretty-much request equal to issue #8209 but instead of focusing on tags, this focuses on branches.

Describe the solution you'd like

New API endpoint POST /api/v1/repos/{owner}/{repo}/branches with payload of tag's name (string) and commit's hash (string)

Describe alternatives you've considered

Cloning repository, and using CLI to do those actions locally, then push them to remote.

Works, but introduces need to execute bash commands on backend server, which is always security concern. Having official API for this will make me sleep better at night 😅

Additional context

Before creating PR for this, I will wait for maintaner response on issue regarding similar feature for tags ( #8209 ) and relevant pull request ( #8212 )

Since solutions will be almost identical, best to first merge tags, and then copy the solution to branches.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    🎯 feature
    on Mar 24, 2026
  2. unknwon commented on Nov 15, 2026

    @unknwon
    Member

    This is implemented in #8566: POST /repos/{owner}/{repo}/branches with {"name": "...", "target": "..."}, where target is a branch, tag or commit SHA and defaults to the default branch. It will ship in 0.15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🎯 feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions