Snapshot and share your code in TFVC

Add your projects to version control to snapshot versions of the code and to share the code with your team. Here, we'll show you how to use Team Foundation Version Control. You can also use Git with Visual Studio Online.

If you keep your code in Visual SourceSafe, you can upgrade to use Visual Studio Online. How?

Do you have version control history in your on-premises TFS that you want to migrate to your Visual Studio Online account? Learn how to do that here.

Open the solution

  1. If you haven't already, connect to your Visual Studio Online account and create your workspace folder.

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

    Move your source code to your workspace folder 

  3. Open your solution in Visual Studio.

    Open your solution in Visual Studio

Add the solution to Visual Studio Online

  1. Add your solution to version control.

    Add the solution to Visual Studio Online

  2. Check in the solution.

    Check in your solution 

  3. Add a comment and check in.

    Add a comment and check in pending changes 

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

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

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

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

  5. Add a comment and check in.

    Source control explorer, source file context menu, check in 

  6. Open the source control explorer.

    Source control explorer in the team explorer home page 

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

Try this next

False