如何使用curl创建bitbucket存储库?

问题描述 投票:1回答:1

我尝试过多种方式

curl -you 'USERNAME' https://api.bitbucket.org/1.0/repositories -d '{"name":"REPO"}'
curl -k -X POST --user user: pass \ "https://api.bitbucket.org/1.0/repositories" -d "name=project_name"

我错过了什么?

curl bitbucket bitbucket-server bitbucket-api
1个回答
5
投票

没关系以下适用于Bitbucket 4.4版

curl -X POST -v -u $uservar:$passvar http://<redacted>/rest/api/1.0/projects/$projectkeyvar/repos -H "Content-Type: application/json" -d "{\"name\": \"$reponamevar\",\"scmId\": \"git\", \"forkable\": true }"

我在shell脚本中使用它,因此是变量。

© www.soinside.com 2019 - 2024. All rights reserved.