Using BitBucket's API to fork a repository

独自空忆成欢 提交于 2019-12-05 22:49:56

You can use the API to fork a repository, either using Basic authorization or OAuth.

The method to fork a repository:

Using a authorized POST-request with required post data "name". https://bitbucket.org/api/1.0/repositories/{accountname}/{repo_slug}/fork/

Full documentation with optional parameters here: http://restbrowser.bitbucket.org/

So..

Tried to contact support via twitter and comments on the API page. Didn't get an answer...

And it seems that they really don't have a method to create forks.

My solution:

  • Created a cURL interface to interact with BitBucket's website, and from there I could fork and create pull requests

If you have a better solution for that, or if they actually have the method on the API, please fell free to drop your answer here.

Follow up: https://bitbucket.org/site/master/issue/4376/api-method-to-fork-a-repository

.

you can to fork the repositories using Bitbucket API without need to username and password, only using bitbucket application.

There is HERE the doc's for POST a new fork.

Also you need to base knowledge of OAuth, following links are helpful .

  1. OAuth on Bitbucket

  2. Use the Bitbucket REST APIs

  3. Bitbucket API version 1

  4. Bitbucket API version 2

  5. Bitbucket REST API Browser

If you are a wordpress developer, this plugin can be helpful for you.

.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!