Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Repository 使用api创建BitBucket团队存储库_Repository_Bitbucket_Bitbucket Api - Fatal编程技术网

Repository 使用api创建BitBucket团队存储库

Repository 使用api创建BitBucket团队存储库,repository,bitbucket,bitbucket-api,Repository,Bitbucket,Bitbucket Api,我需要使用Sign Bitbucket的API创建团队存储库 要创建用于创建的用户存储库,请执行以下操作: $ curl -k -X POST -u username:passwd "https://api.bitbucket.org/1.0/repositories" -d "name=myrep" 如果不是为了一个团队,我该怎么做呢?好的,我终于在文档中找到了答案。到目前为止,文档对我来说还不是很清楚,特别是关于API版本2的使用。但这段隐藏的代码解释了API 2的工作原理: $ team

我需要使用Sign Bitbucket的API创建团队存储库

要创建用于创建的用户存储库,请执行以下操作:

$ curl -k -X POST -u username:passwd "https://api.bitbucket.org/1.0/repositories" -d "name=myrep"

如果不是为了一个团队,我该怎么做呢?

好的,我终于在文档中找到了答案。到目前为止,文档对我来说还不是很清楚,特别是关于API版本2的使用。但这段隐藏的代码解释了API 2的工作原理:

$ team=myteam
$ repo=repository
$ curl -X POST -v -u username:password -H "Content-Type: application/json" \
  https://api.bitbucket.org/2.0/repositories/${team}/${repo} \
  -d '{"scm": "git", "is_private": "true", "fork_policy": "no_public_forks" }'
关于如何处理数据(-d),API1的不同之处在于API2使用JSON格式

此处的相关文件取自此处: