You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I would like to fork a repository with Bitbucket API like GitHub has. https://developer.github.com/v3/repos/forks/#create-a-fork. Is it possible?
Thanks in advance.
API v2 for documentation:
Overview of solution is to POST to the /repo/forks/ endoint
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I appreciate your answer but they talked about old API version in the thread and I cannot find the same one in new API version below:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The 2.0 documentation is here but the POST body seems complicated. Would really like some actual examples... ie what are the minimum required fields?
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-post
I was able to figure this out using chrome tools while creating a fork from the BB UI. Here is a minimal example:
Imagine I have a repo `foo` in workspace `myspace`. And I want to fork it into `foo-fork` in the same workspace. The request is
POST {{BB_API}}/repositories/myspace/myspace/forks
{"is_private": true,"scm": "git","name": "foo-fork","workspace":{"slug":"myspace"}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.