Skip to content

Commit 91c4e42

Browse files
committed
First draft of the updated TFVC guidance.
1 parent cf7856b commit 91c4e42

File tree

2 files changed

+106
-26
lines changed

2 files changed

+106
-26
lines changed

mac/media/tfvc-install.png

323 KB
Loading

mac/tf-version-control.md

Lines changed: 106 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: "Team Foundation Version Control (TFVC)"
3-
description: "Connecting to Team Foundation Server or Azure DevOps Services with Team Foundation Version Control (TFVC)."
3+
description: "Connecting from Visual Studio for Mac to Team Foundation Server/Azure DevOps with Team Foundation Version Control (TFVC)."
44
author: conceptdev
55
ms.author: crdun
6-
ms.date: 09/05/2018
6+
ms.date: 04/04/2019
77
ms.topic: article
88
ms.technology: vs-ide-general
99
ms.assetid: 52D3D26A-4D01-4FD1-AAA1-AE7D7BD39746
@@ -12,33 +12,113 @@ ms.assetid: 52D3D26A-4D01-4FD1-AAA1-AE7D7BD39746
1212
# Connecting to Team Foundation Version Control
1313

1414
> [!NOTE]
15-
> Team Foundation Version Control support is currently in preview and some functionality is not yet fully working. We'd love feedback from you on any issues at [Developer Community](https://developercommunity.visualstudio.com/spaces/41/index.html). More changes are still to come!
15+
> For the best version control experience on macOS, we recommend using Git instead of Team Foundation Version Control (TFVC).
16+
Git is supported in Visual Studio for Mac and is the default option for repositories hosted in Team Foundation Server (TFS)/Azure DevOps. To learn more about using Git with TFS/Azure DevOps, see the [Setting up a Git Repository](./set-up-git-repository) article.
1617

17-
Azure Repos provides two models of version control: Git, which is distributed version control, and Team Foundation Version Control (TFVC), which is centralized version control. This article provides an overview and a starting point for using TFVC with Visual Studio for Mac.
18+
Azure Repos provides two models of version control: Git, which is distributed version control, and Team Foundation Version Control (TFVC), which is centralized version control.
19+
20+
Visual Studio for Mac provides full support for Git repositories, but requires some workarounds to work with TFVC. If you're using TFVC for version control today, here are some solutions you can use to access your source code hosted in TFVC.
21+
22+
* [Use Visual Studio Code and the Azure Repos extension, for a graphical UI](#use-visual-studio-code-and-the-azure-repos-extension)
23+
* [Connect to your repo using the Team Explorer Everywhere Command Line Client (TEE-CLC)](#connecting-using-the-team-explorer-everywhere-command-line-client)
24+
* [Connect to TFVC using the (unsupported) Team Foundation Version Control extension for Visual Studio for Mac](#connect-to-tfvc-using-the-team-foundation-version-control-extension)
25+
26+
The rest of this article walks you through the options listed above.
1827

1928
## Requirements
2029

21-
* Visual Studio Community, Professional, or Enterprise for Mac version 7.5 or later.
22-
* Azure DevOps Services, or Team Foundation Server 2013 and later.
23-
* A project in Azure DevOps Services or Team Foundation Server, configured to use Team Foundation Version Control.
30+
* Visual Studio Community, Professional, or Enterprise for Mac version 7.8 or later.
31+
* Azure DevOps Services, Team Foundation Server 2013 and later, or Azure DevOps Server 2018 and later.
32+
* A project in Azure DevOps Services or Team Foundation Server/Azure DevOps Server, configured to use Team Foundation Version Control.
33+
34+
## Use Visual Studio Code and the Azure Repos extension
35+
36+
If you like to work with a graphical interface for managing you local version control, then the Azure Repos extension for Visual Studio Code provides a supported solution from Microsoft. To get started, download [Visual Studio Code](https://code.visualstudio.com) and then learn how to [configure the Azure Repos extension](https://marketplace.visualstudio.com/items?itemName=ms-vsts.team).
37+
38+
## Connecting using the Team Explorer Everywhere Command Line Client
39+
40+
If you're comfortable using the macOS Terminal, then the Team Explorer Everywhere Command Line Client (TEE-CLC) provides a supported way to connect to your source in TFVC.
41+
42+
Special thanks to Chris Pilcher, a developer in our community, who's [original instructions for the TEE-CLC](https://gist.github.com/chris-pilcher/a3f14eb081d7ab983e5c) formed the basis of this section.
43+
44+
### Setting up the TEE-CLC
45+
46+
There are two ways to get setup with the TEE-CLC.
47+
48+
1. Use Homebrew to install the client.
49+
1. Download and manually install the client.
50+
51+
The easiest solution is **using HomeBrew**, which is a package manager for macOS. To install using this method:
52+
53+
1. Launch the macOS Terminal application.
54+
1. Install Homebrew using the Terminal and the instructions on the [Homebrew home page](https://brew.sh/).
55+
1. Once Homebrew is installed, run the following command from your Terminal: `brew install tee-clc`
56+
57+
To **setup the TEE-CLC manually**:
58+
59+
1. [Download the latest version of the tee-clc](https://github.com/Microsoft/team-explorer-everywhere/releases) from the releases page of the Team Explorer Everywhere GitHub repo (e.g. tee-clc-14.134.0.zip at the time of this writing).
60+
1. Extract the content of the .zip to a folder on disk.
61+
1. Open the macOS Terminal app and use the `cd` command to switch to the folder you used in the previous step.
62+
1. From within the folder, run the command `./tf` to test that the command line client can run, you may be prompted to install Java or other dependencies.
63+
64+
Once the TEE-CLC is installed, you can run the command `tf eula` to view and accept the license agreement for the client.
2465

25-
## Installation
66+
Finally, to authenticate with your TFS/Azure DevOps environment, you'll need to create a personal access token on the server. Learn more about [authenticating with personal access tokens](https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/pats?view=azure-devops).
2667

27-
In Visual Studio for Mac, choose **Visual Studio > Extensions** from the menu. In the **Gallery** tab, select **Version Control > Team Foundation Version Control for TFS and VSTS** and click **Install**:
68+
### Using the TEE-CLC to connect to your repo
69+
70+
To connect to your source code, you first need to create a workspace using the `tf workspace` command. For example, the following commands connect to an Organization in Azure DevOps Services called "MyOrganization":
71+
72+
```
73+
export TF_AUTO_SAVE_CREDENTIALS=1
74+
tf workspace -new MyWorkspace -collection:https://dev.azure.com/MyOrganization
75+
```
76+
77+
The `TF_AUTO_SAVE_CREDENTIALS` environment setting is used to save your credentials so you aren't prompted to enter them multiple times. When prompted for a user name, use the personal access token you created in the previous section and use a blank password.
78+
79+
Now, to create a mapping of your source files to a local folder, you'll use the `tf workfold` command. The following example will map a folder named "WebApp.Services" from the "MyRepository" TFVC project and set it up to be copied into the local ~/Projects/ folder (i.e. a "Projects" folder in the current users's home folder).
80+
81+
```
82+
tf workfold -map $/MyRepository/WebApp.Services -workspace:MyWorkspace ~/Projects/
83+
```
84+
85+
Finally, you use the following command to get the source files from the server and copy them locally:
86+
87+
```
88+
tf get
89+
```
90+
91+
### Committing changes using the TEE-CLC
92+
93+
After you've made changes to your files in Visual Studio for Mac, you can switch back to the Terminal to check in your edits. The `tf add` command is used to add files to the list of pending changes to be checked-in and the `tf checkin` command performs the actual check-in to the server. The `checkin` command includes parameters to add a comment or associate a related work item. In the following code snippet, all files in a `WebApp.Services` folder are added, recursively, to the checkin. Then, the code is checked in with a comment and associated with a work item with the ID "42".
94+
95+
```
96+
cd WebApp.Services
97+
tf add * /recursive
98+
tf checkin -comment:"Replaced 'Northwand' typos with the correct word Northwind" -associate:42
99+
```
100+
101+
To learn more about the commands mentioned here, or others, you can use the following command from the Terminal:
102+
103+
`tf help`
104+
105+
## Connect to TFVC using the Team Foundation Version Control extension
106+
107+
In the Visual Studio for Mac Extension gallery, there is a Team Foundation Version control extension that offers limited support to connect to TFVC. The extension is not supported and has several known issues, so your experience may vary when using it.
108+
109+
To install the extension, launch Visual Studio for Mac and choose the **Visual Studio > Extensions** menu. In the **Gallery** tab, select **Version Control > Team Foundation Version Control for TFS and Azure DevOps** and click **Install...**:
28110

29111
![Extension manager](media/tfvc-install.png)
30112

31113
Follow the prompts to install the extension. Once it's installed, restart the IDE.
32114

33-
## Updating the extension
115+
### Updating the extension
34116

35117
Updates to the TFVC extension are made periodically. To access updates, choose **Visual Studio > Extensions...** from the menu and select the **Updates** tab. Select the extension in the list and press the **Update** button:
36118

37-
![Extension manager showing update](media/tfvc-update.png)
38-
39119
Press **Install** on the next dialog to uninstall the old package and install the new one.
40120

41-
## Using the add-in
121+
### Using the add-in
42122

43123
Once the extension is installed, select the **Version Control > TFS/Azure DevOps > Open from Remote Repository** menu item.
44124

@@ -48,19 +128,19 @@ Choose either VSTS or Team Foundation Server to get started and press **Continue
48128

49129
![Connect with a Server](media/tfvc-choose-server-type-devops.png)
50130

51-
### Azure Repos Authentication
131+
#### Azure Repos Authentication
52132

53133
When you select a project that is hosted on Azure Repos, you're prompted to enter your Microsoft account details:
54134

55135
![Connect with Azure Repos](media/tfvc-vsts-login.png)
56136

57-
### TFS Authentication
137+
#### TFS Authentication
58138

59139
To connect to TFS, enter the server details and your account credentials. Enter a domain to use NTLM authentication, otherwise leave blank to use basic authentication. Select **Add Server**:
60140

61141
![Sign in to a TFS Server](media/tfvc-login.png)
62142

63-
## Selecting a project
143+
### Selecting a project
64144

65145
Once you've successfully authenticated, you can see a list of repositories that are associated with the account in the **Open from Source Control** dialog:
66146

@@ -73,7 +153,7 @@ This dialog is organized with the following nodes:
73153

74154
At this point, you can search and filter by the name of a project or organization.
75155

76-
### Adding a new server
156+
#### Adding a new server
77157

78158
To add a new server to the list, press the **Add Host** button on the **Open from Source Control** dialog:
79159

@@ -83,7 +163,7 @@ Select the provider from the list, and enter your credentials:
83163

84164
![Dialog showing option for source control provider](media/tfvc-add-new-creds-devops.png)
85165

86-
## Creating a new workspace
166+
### Creating a new workspace
87167

88168
To start working with a project, you need to have a _workspace_. If you don't already have a workspace, you can create one from the **Workspace** combobox in the **Open from Source Control** dialog:
89169

@@ -93,7 +173,7 @@ Set the name and local path for your new workspace and select **Create Workspace
93173

94174
![Entering a name and local path for the new workspace](media/tfvc-local-workspace.png)
95175

96-
## Using the Source Code Explorer
176+
### Using the Source Code Explorer
97177

98178
Once you've created a workspace and mapped your project, you can start working with the _Source Code Explorer_.
99179

@@ -113,7 +193,7 @@ Many of these actions are available through context actions on the project:
113193

114194
![Context menu actions for a project](media/tfvc-sourcecode-actions.png)
115195

116-
## Managing workspaces
196+
### Managing workspaces
117197

118198
If you haven't already created a workspace, as described in the [Creating a workspace](#creating-a-new-workspace) section, you'll notice that the Source Code Explorer is empty:
119199

@@ -140,9 +220,9 @@ Once your workspace is set up, it can be changed or removed by clicking the **Ma
140220

141221
![Manage Workspaces](media/tfvc-workspace4.png)
142222

143-
## Troubleshooting
223+
### Troubleshooting
144224

145-
### Problems using basic authentication
225+
#### Problems using basic authentication
146226

147227
The following options can be used to authenticate with a server:
148228

@@ -162,26 +242,26 @@ To use basic authentication it is necessary to enable **Alternative authenticati
162242

163243
![Policy settings option selected](media/tfvc-auth.png)
164244

165-
### I do not see anything in TFVC
245+
#### I do not see anything in TFVC
166246

167247
To set up Team Foundation Version Control (TFVC) on your dev machine, you **must** create a workspace, as described in the [Managing workspaces](#managing-workspaces) section.
168248

169249
In Source Control Explorer, press the **Manage Workspaces** Button. Follow the steps to map the project to a folder on your dev machine.
170250

171-
### I do not see any / all of my projects
251+
#### I do not see any / all of my projects
172252

173253
After authenticating you should see the list of projects. By default, only TFS projects are shown. To see other types of projects, check the "See all projects" box.
174254

175255
Keep in mind that projects that are on the server will not appear if you don't have the correct privileges.
176256

177-
#### I am getting the error "Cannot create the workspace. Please, try again"
257+
##### I am getting the error "Cannot create the workspace. Please, try again"
178258

179259
When trying to [create a new workspace](#creating-a-new-workspace), you should make sure the following conditions are met:
180260

181261
- No use of invalid characters in the workspace name.
182262
- The name must be less than 64 characters.
183263
- The local path cannot be used by any other workspaces.
184264

185-
## See also
265+
### See also
186266

187267
- [Develop and share your code in TFVC using Visual Studio (on Windows)](/azure/devops/repos/tfvc/share-your-code-in-tfvc-vs)

0 commit comments

Comments
 (0)