【问题标题】:Set VSTS Compare Branch using REST API使用 REST API 设置 VSTS 比较分支
【发布时间】:2018-02-26 16:35:06
【问题描述】:

在 Visual Studio Team Services (VSTS) 中使用记录在案的 REST API (latest documentation),您可以初始化您的第一个分支、创建其他分支并更新 GIT 存储库的默认分支。

更新默认分支时,新的默认分支自动成为比较分支。

所以我的问题是,有没有办法使用 REST API 来修改比较分支?

【问题讨论】:

    标签: azure-devops azure-devops-rest-api


    【解决方案1】:

    补丁https://{account}.visualstudio.com/_apis/Settings/Repository/{repository id}/Entries/me?api-version=4.1-preview.1

    内容类型:application/json

    主体:

    {
        "Branches.Compare":"refs/heads/Dev1"
    }
    

    您可以通过Git repositories REST API 获取存储库ID。

    【讨论】:

    • 谢谢!完美地工作。在 URI 上调用 Get 会返回:Branches.Compare 和 Git/DefaultUserBranch 也适用于 api 版本 4.1-Preview 无法找到任何支持文档:(
    猜你喜欢
    • 2022-10-05
    • 1970-01-01
    • 1970-01-01
    • 2019-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-19
    相关资源
    最近更新 更多