【问题标题】:what will be the request body for create repository in azure devops?在 azure devops 中创建存储库的请求正文是什么?
【发布时间】:2020-04-29 08:05:03
【问题描述】:

我想使用 rest api 在 azure devops 中创建一个 git 存储库。 发布https://dev.azure.com/{organization}/{project}/_apis/git/repositories?api-version=5.1

【问题讨论】:

    标签: azure


    【解决方案1】:

    请求正文应该是这样的。

    { "name": "repo_name", "teamProjectReference": { "id": "azure_project_id" } }

    另外,您可以通过此链接更好地了解https://docs.microsoft.com/en-us/rest/api/azure/devops/git/repositories/create?view=azure-devops-rest-5.1

    【讨论】:

      【解决方案2】:

      您只需要在正文中传递存储库name项目id

      {
        "name": "AnotherRepository",
        "project": {
          "id": "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c"
        }
      }
      

      另请参阅:Create a repository

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-05-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-11-08
        相关资源
        最近更新 更多