Public API: Create branch
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 47.8k
- Forks
- 5.1k
- Avg merge
- 7h 23m
- Merged PRs (30d)
- 5
Description
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 https://github.com/gogs/gogs/issues/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 ( https://github.com/gogs/gogs/issues/8209 ) and relevant pull request ( https://github.com/gogs/gogs/pull/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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading issue #8209 and pull request #8212, then inspect the existing List branches API entry point. The work is done when POST /api/v1/repos/{owner}/{repo}/branches accepts a branch name and commit hash and creates the branch through the public API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, go
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100