本文介绍了使用 BitBucket 的 API 来分叉存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用 BB 的 API 来分叉存储库?

There's any way to fork a repository using BB's API?

从我在 API 文档中读到的内容来看,没有任何明确的内容:https://confluence.atlassian.com/display/BITBUCKET/Repositories

From what I've read on the API's docs, there isn't any explicit one: https://confluence.atlassian.com/display/BITBUCKET/Repositories

我的想法是创建一个新的 repo 并指出它是另一个 repo 的分支,以便我稍后创建拉取请求.

My idea is to create a new repo and point that it's a fork of another one, so I can create pull requests later.

推荐答案

您可以使用 API 来分叉存储库,使用基本授权或 OAuth.

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

fork 仓库的方法:

The method to fork a repository:

使用具有所需发布数据名称"的授权 POST 请求.https://bitbucket.org/api/1.0/repositories/{accountname}/{repo_slug}/叉/

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

带有可选参数的完整文档:http://restbrowser.bitbucket.org/

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

这篇关于使用 BitBucket 的 API 来分叉存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 01:36
查看更多