Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.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
Git 如何通过shell命令行授予组对Bitbucket存储库的写访问权限_Git_Shell_Bitbucket_Jenkins Pipeline_Usergroups - Fatal编程技术网

Git 如何通过shell命令行授予组对Bitbucket存储库的写访问权限

Git 如何通过shell命令行授予组对Bitbucket存储库的写访问权限,git,shell,bitbucket,jenkins-pipeline,usergroups,Git,Shell,Bitbucket,Jenkins Pipeline,Usergroups,我使用Jenkins文件创建了一个Bitbucket存储库,代码如下(私有数据替换为{}): 这将创建具有默认访问权限的存储库 然后,我需要授予组对此存储库的写访问权 我浏览了互联网,找不到任何最新的文档或例子来说明如何做到这一点。如何使用shell命令执行此操作?您需要的是:“权限”:“写入” 以下是用于更新组权限的API调用: "permission":"write" 完整API调用: curl --request PUT --user username:password \ <

我使用Jenkins文件创建了一个Bitbucket存储库,代码如下(私有数据替换为{}):

这将创建具有默认访问权限的存储库

然后,我需要授予组对此存储库的写访问权


我浏览了互联网,找不到任何最新的文档或例子来说明如何做到这一点。如何使用shell命令执行此操作?

您需要的是:
“权限”:“写入”

以下是用于更新组权限的API调用:

"permission":"write"

完整API调用:

curl --request PUT --user username:password \ 
<repo url> \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data '{"name":"developers","permission":"write","auto_add":true}'
curl--request PUT--user username:password\
\
--标题“内容类型:应用程序/json”\
--标题“接受:应用程序/json”\
--数据“{”name:“developers”,“permission:“write”,“auto_add”:true}”

文件应该是什么格式?我似乎得到一个没有这样的文件或目录错误,无论我把什么。此外,更进一步,我如何做到这一点而不必在请求中输入原始用户名和密码?是否可以改用基本授权令牌?给定存储库的bitbucket URL我成功地完成了shell命令,但它似乎没有改变存储库中的任何内容。我要四处看看,看看能不能找到原因。谢谢你迄今为止的帮助!我在网上找到的文档建议URL采用以下格式:。这是你期望的格式吗?在我看来,这种格式类似于更新组内的组权限,而不是将组添加到存储库。my repository()命令的原始URL有效,但不会导致将组添加到repo。
curl --request PUT --user username:password \ 
<repo url> \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data '{"name":"developers","permission":"write","auto_add":true}'