gpt4 book ai didi

git - 使用 REST API 设置默认分支

转载 作者:太空狗 更新时间:2023-10-29 14:05:29 25 4
gpt4 key购买 nike

是否可以使用 Visual Studio Team Service REST API 以某种方式设置 Git 存储库的默认分支?有一个 API for repositories和一个用于设置默认分支的 UI,但我找不到通过 REST API 设置默认分支的可能性。

最佳答案

API 可以在这里找到:Update repository

调用:

PATCH https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}?api-version=5.1

有效载荷:

{
"defaultBranch": "refs/heads/{branchName}"
}

关于git - 使用 REST API 设置默认分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34343027/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com