【问题标题】:How to create a remote TFSGIT Repo programatically?如何以编程方式创建远程 TFS GIT Repo?
【发布时间】:2017-06-02 19:01:19
【问题描述】:

我可以使用任何 API 在远程 TFS 服务器中创建新的 GIT 存储库吗?

最好是这样的

New-GitRepo -server myServer -team team1 -name myRepo

如果没有 powershell api,我可以使用 RESTful HTTP 端点

【问题讨论】:

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


    【解决方案1】:

    答案在文档中:

    使用 REST API:

    POST https://{instance}/DefaultCollection/_apis/git/repositories/?api-version={version}
    Content-Type: application/json
    
    {
      "name": {string},
      "project": {
        "id": {guid}
      }
    }
    

    虽然我不知道这个 API 是从哪个 TFS 版本开始可用的。鉴于您标记了 TFS2015,并且 API 兼容性已从 RTM 更改为更新 3。

    【讨论】:

      猜你喜欢
      • 2021-07-03
      • 2019-04-14
      • 1970-01-01
      • 1970-01-01
      • 2018-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多