如何在 Visual Studio 代码中连接 TFS [英] How to connect TFS in Visual Studio code

查看:150
本文介绍了如何在 Visual Studio 代码中连接 TFS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 VS 代码的新手.到目前为止,它看起来非常好,而且比 VS 轻得多.我如何将我现有的 TFS 服务器连接到 VS 代码(我的 TFS 必须留在本地 - 公司要求).我读到这是可以做到的,但到目前为止我只看到了 Git 或 TFVC 的例子.

解决方案

正如 Daniel 所说Git 和 TFVC 是 TFS 中的两个源代码控制选项".幸运的是,目前 VS Code 都支持两者.

您需要安装

I'm new to VS code. So far it seems very nice and much lighter than VS. How could I connect my existing TFS server to VS code (my TFS must stay on premises - company requirements). I read that this can be done but so far I've seen only examples for Git or TFVC.

解决方案

Just as Daniel said "Git and TFVC are the two source control options in TFS". Fortunately both are supported for now in VS Code.

You need to install the Azure Repos Extension for Visual Studio Code. The process of installing is pretty straight forward.

  1. Search for Azure Repos in VS Code and select to install the one by Microsoft
  2. Open File -> Preferences -> Settings
  3. Add the following lines to your user settings

    If you have VS 2015 installed on your machine, your path to Team Foundation tool (tf.exe) may look like this:

    {
        "tfvc.location": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\tf.exe",
        "tfvc.restrictWorkspace": true
    }

    Or for VS 2017:

    {
        "tfvc.location": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\tf.exe",
        "tfvc.restrictWorkspace": true
    }

  4. Open a local folder (repository), From View -> Command Pallette ..., type team signin

  5. Provide user name --> Enter --> Provide password to connect to TFS.

Please refer to below links for more details:

Note that Server Workspaces are not supported:

"TFVC support is limited to Local workspaces":

这篇关于如何在 Visual Studio 代码中连接 TFS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆