You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

TFS 2017 Git仓库列表API未返回SSH URL问题咨询

Why the Git Repositories List API Doesn't Return SSH URLs in TFS Server 2017 (API ≤3.0)

Having worked with TFS Server 2017 extensively, I’ve run into this exact issue before—here’s why you’re not seeing SSH URLs in the API response and how to handle it:

  • API Version Constraints: TFS Server 2017 ships with Git REST API v3.0 (and older), which predates the SSH URL field added in later Azure DevOps API versions. The on-premises TFS API stack for 2017 simply wasn’t updated to include this field in the repository list endpoint—this is a design limitation tied to the version’s feature scope, not an oversight.

  • SSH Integration Maturity: While TFS 2017 does support SSH cloning for Git repositories, the REST API endpoints at the time didn’t expose this URL. Back then, HTTP/HTTPS was still the primary focus for cloning in the API, and SSH’s API-level exposure was a lower priority for on-premises TFS releases.

  • Practical Workaround: Construct SSH URLs Manually: TFS uses a predictable SSH URL structure, so you can build it using data from the HTTP URL the API does return:

    • ssh:// format: ssh://<your-username>@<tfs-server-host>:<ssh-port>/<collection-name>/<project-name>/_git/<repo-name>
    • git@ format (if your TFS instance is configured for it): git@<tfs-server-host>:<collection-name>/<project-name>/_git/<repo-name>
    • Just extract the server host, collection, project, and repository name from the remoteUrl field (the HTTP URL returned by the API) and plug them into these templates.

Quick note: Ensure your TFS Server 2017 instance has SSH access enabled for Git repos first—this is a server-level setting that needs to be configured separately.

内容的提问来源于stack exchange,提问作者Abhishek Attri

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 08:51:55