Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.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 分支和标记无法通过API删除_Git_Curl_Gitlab_Gitlab Api - Fatal编程技术网

Git 分支和标记无法通过API删除

Git 分支和标记无法通过API删除,git,curl,gitlab,gitlab-api,Git,Curl,Gitlab,Gitlab Api,问题: 将GitLab从9.3.6升级到10.3.5后,如果分支和标记删除API包含/在名称中,则该API不起作用(例如release/branch)。但它在旧版本中有效 C:\Users\test>curl.exe --request DELETE --header "PRIVATE-TOKEN:token" "https://gitlab.company.com/api/v4/projects/1582/repository/branches/test/test" {"error":"

问题:

将GitLab从
9.3.6
升级到
10.3.5
后,如果分支和标记删除API包含/在名称中,则该API不起作用(例如
release/branch
)。但它在旧版本中有效

C:\Users\test>curl.exe --request DELETE --header "PRIVATE-TOKEN:token" "https://gitlab.company.com/api/v4/projects/1582/repository/branches/test/test"
{"error":"404 Not Found"}
C:\Users\test>curl.exe --request DELETE --header "PRIVATE-TOKEN:token" "https://gitlab.company.com/api/v4/projects/1582/repository/branches/testz"
C:\Users\test>curl.exe --request DELETE --header "PRIVATE-TOKEN:token" "https://gitlab.company.com/api/v4/projects/1582/repository/tags/tag/test"
{"error":"404 Not Found"}
C:\Users\test>curl.exe --request DELETE --header "PRIVATE-TOKEN:token" "https://gitlab.company.com/api/v4/projects/1582/repository/tags/tagtest"

在上面的curl数据中,我可以删除分支
testz
,但是
test/test
也会在
标记中抛出相同的错误。如何通过API删除这些分支?

因为它是一个URL,有些字符在上下文之外是不能使用的。例如,在URL的中间没有一个“代码”>Straye} /代码>,即使该区域表示一个字符串,所以您必须使用<代码> %20 而不是<代码> 对于
test/test
,您可能需要将
/
替换为
%2F

所以测试%2Ftest