Skip to content

Latest commit

 

History

History
173 lines (102 loc) · 6.32 KB

share-your-code-in-tfvc-vs.md

File metadata and controls

173 lines (102 loc) · 6.32 KB
title description ms.assetid toc ms.prod ms.technology ms.manager ms.author author ms.topic ms.date monikerRange
Develop and share your code in TFVC using Visual Studio | VSTS
Share code in Team Foundation Version Control using Visual Studio
108544c0-c29e-4b3b-9a39-4573cf4a71dc
show
devops
devops-code-tfvc
douge
sdanie
steved0x
quickstart
08/10/2016
>= tfs-2015

Develop and share your code in TFVC using Visual Studio

VSTS | TFS 2018 | TFS 2017 | TFS 2015 | VS 2017 | VS 2015 | VS 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 VSTS.

Is your code in another place? Learn how to migrate it here.

[!INCLUDE open-team-project-in-vs]

Configure your workspace

  1. In Visual Studio, configure your workspace.

    On Team Explorer home page, click Configure Workspace

    I don't see the Configure Workspace link. What do I do next?

  2. Confirm your workspace path, map your workspace, and get the source.

    On Team Explorer home page, click Map and get

  3. Now you can check in source, queue builds, and manage work.

    Visual Studio is now connected to your team project

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.

New solution from team explorer

Now that you've added your app, you can skip down to snapshot your code.

Add an existing app

Move and open the solution

  1. Close the solution.

  2. Open the workspace folder that you created when you configured your workspace.

Open the workspace folder from source control explorer

  1. Move the code you want to upload to the workspace folder.

Move your source code to your workspace folder

  1. Open your solution in Visual Studio.

Open your solution in Visual Studio

Add the solution to VSTS

  1. Open the solution explorer (Keyboard: Ctrl + Alt + L).

  2. Add your solution to version control.

Add the solution to VSTS

  1. Check in the solution.

Check in your solution

  1. Add a comment and check in.

Add a comment and check in pending changes

  1. Open the source control explorer.

Open the source control explorer

Your solution is now in TFS.

Your solution in the source control explorer

Your whole team can work on the code now. All your changes are tracked in version control.

Snapshot (check in) your code

  1. 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.

Checked out file in the team explorer

  1. Compare the modified file with the latest version in source control.

Compare in the solution explorer's context menu

You can see the difference between the two versions.

Compare window

  1. Check in the changes.

Check in from the context menu in the solution explorer

You can also check in from the code window, or the team explorer.

  1. 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.

Related work items in pending changes

  1. Add a comment and check in.

Source control explorer, source file context menu, check in

  1. Open the source control explorer.

Source control explorer in the team explorer home page

  1. View the history of the file you changed.

Source control explorer, source file context menu, view history

All the changesets that include this file are listed.

History window

Troubleshooting

My code is somewhere else. Can I migrate it to my TFVC project on VSTS?

Yes:

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.

In Team Explorer, click Source Control Explorer or Manage Workspaces

Next steps

[!div class="nextstepaction"] Get your code reviewed