Develop and share your code in TFVC using Visual Studio
Azure DevOps Services | Azure DevOps Server 2020 | Azure DevOps Server 2019 | TFS 2018 - TFS 2013
Visual Studio 2019 | Visual Studio 2017 | Visual Studio 2015 | Visual Studio 2013
Whether your software project is large, small, or brand new, in most cases you'll be better off if you use version control as early as possible. Here, we'll show you how to get started with Team Foundation Version Control (TFVC), a centralized system. If you want to work in a distributed system, you can instead use Git with Azure Repos.
Is your code in another place? Learn how to migrate it here.
Open your project in Visual Studio
Before you start, if you haven't already:
Go to your project's page (
https://dev.azure.com/{your organization}/{your team project}
) and then open Visual Studio to connect to your project.Sign in to Azure DevOps Services from Visual Studio.
Configure your workspace
In Visual Studio, configure your workspace.
I don't see the Configure Workspace link. What do I do next?
Confirm your workspace path, map your workspace, and get the source.
Now you can check in source, queue builds, and manage work.
Note
TFVC is not supported when workspaces are placed on network drives or UNC paths.
Create a new app
If you already have an app that you want to add to version control, skip down to Add an existing app.
Now that you've added your app, you can skip down to snapshot your code.
Add an existing app
Move and open the solution
Close the solution.
Open the workspace folder that you created when you configured your workspace.
Move the code you want to upload to the workspace folder.
Open your solution in Visual Studio.
Add the solution to Azure Repos
Open the solution explorer (Keyboard: Ctrl + Alt + L).
Add your solution to version control.
Check in the solution.
Add a comment and check in.
Open the source control explorer.
Your solution is now in TFS.
Your whole team can work on the code now. All your changes are tracked in version control.
Snapshot (check in) your code
When you edit code in Visual Studio, the changed file is automatically checked out. For example, Site.css is checked out after the border color has been changed to #ddd.
Compare the modified file with the latest version in source control.
You can see the difference between the two versions.
Check in the changes.
You can also check in from the code window, or the team explorer.
If you're working on a task or fixing a bug that's tracked as a work item, add that work item to your pending changes. Source control will resolve the bug or close the task, and it'll link the changeset to the work item.
Add a comment and check in.
Open the source control explorer.
View the history of the file you changed.
All the changesets that include this file are listed.
Troubleshooting
- My code is somewhere else. Can I migrate it to my TFVC project on Azure DevOps Services?
- I don't see the Configure Workspace link shown in the steps above. What do I do next?
My code is somewhere else. Can I migrate it to my TFVC project on Azure DevOps Services?
Yes. See Migrate from Team Foundation Server into Azure DevOps Services.
I don't see the Configure Workspace link shown in the steps above. What do I do next?
You might already have a workspace on your computer. To see your workspace, open Source Control Explorer. Or change your workspace. Find out how to manage files under source control or manage workspaces.