Set up Team Foundation Version Control on your dev machine
VSTS | TFS 2018 | TFS 2017 | TFS 2015 | VS 2017 | VS 2015 | VS 2013
To set up Team Foundation Version Control (TFVC) on your dev machine, you just need to create a workspace and then add your code.
Before you start
If you don’t have Visual Studio, get it here.
Create a workspace and get the code
From Visual Studio, go to the Team Explorer Connect page (Keyboard: Ctrl + 0, C) and then connect to the team project.
(If the team project you want to open is not listed, choose Select Team Projects and then connect to the team project.)
Map the team project to a folder on your dev machine.
Map the workspace and get your code.
Work in a “Main” parent folder
Do you want to prepare for when your team grows large enough to need branches to manage your work? Put all your code in a parent called Main (for example:
Go to the Team Explorer Home page (Keyboard: Ctrl + 0, H), and then open Source Control Explorer.
In Source Control Explorer, select your team project in the left pane.
On the menu bar choose File, Source Control, New Folder.
Name the folder.
Open the context menu of the
Mainfolder and choose Check in.
Check in the new folder.
Your changeset is checked in.
When your team decides to branch the codebase, you can convert the Main folder to a branch. See Branch folders and files.
Add your code to version control
Create a new solution under version control
If you've got an idea for a new app, you can use version control from the start. Create a new code project (Keyboard: Ctrl + Shift + N), and add it to TFVC version control:
Tip: We suggest that you put your new project in c:\Users\YourName\Source\Workspaces\.
When the Choose Source Control dialog box appears, choose Team Foundation Version Control.
When you are ready, check in your changes (Keyboard: Ctrl + 0, P).
Put an existing solution under version control
You’ve already got an app in progress and you want to begin working on it under TFVC version control.
Move your solution into your workspace folder (for example: c:\Users\YourName\Source\Workspaces\YourTeamProject\Main\).
If you have not already done so, open your solution, (Keyboard: Ctrl + Shift + O) and then open Solution Explorer (Keyboard: Ctrl + Alt + L).
Add your solution to source control.
On the Choose Source Control dialog box, choose Team Foundation Version Control.
When you are ready, check in your changes (Keyboard: Ctrl + 0,P).
Q & A
Q: I’m really new to all this; can I get more help?
Q: Is your folder structure complex or do you use branches?