Team Foundation Version Control with Visual Studio

Now that you know how to create Sprints, Product Backlog Items and Tasks, it’s finally time to get your hands dirty and start writing some code!
Of course, as a collaborative team following Scrum, you need a version control system that helps keep track of the current status of tasks and the associated code.

This is where Team Foundation Version Control (TFVC) come into play.


Creating Solution within Team Project

Creating Solution within Team Project

Picking up where we left off the last time, let’s create a new solution within the Team Project.It’s straight forward, just go to Team Explorer and click New under Solutions’ tab.

The type of the solution here is totally dependent on the project you are working on, TFVC supports whatever solution you choose.

Team Explorer with task assigned

You may also get this interface instead of the one above if there are already tasks assigned to you in the current Team Project.


Checking-in Pending Changes

The process of pushing the changes in the client (Visual Studio) to the server (TFS) is called check-in in TFVC.
Pending Changes Checking-in

Creating the solution doesn't automatically send it to the server, so you have to do it yourself.

In order to do so, go to Pending Changes and manage the list of files to check-in by dragging them to either Excluded or Included Changes.
Then, provide a meaningful comment for the check-in and hit, you guessed it, check-in.

This process is the same for a new solution or changes in the current solution so you will find yourself using it very often.

Now you can go to TFS Web Interface and browse the checked-in code along with its history.


Working with Tasks

My Work

Now let’s go to My Work to see the work waiting for us.

Notice that My Work includes, not only tasks, but also Product Backlog Items(PBI) ,thus the two icons surrounded in blue.

In order to start working on a task, drag it along with its PBI to
In Progress Work tab then go back to the Solution Explorer and start writing the code associated.

Suspending In Progress Work

In case you are already working on a task and another urgent one just popped up, let’s say that ‘Fix Critical Bug’ task, you can Suspend In Progress Work, which saves all the changes you have made to the server without merging them with the Project’s code and restore your local code as if you never started the suspended tasks.

When you finish the critical task and check it in, resume the Suspended Work and continue working.


Task State Management

One of the most useful features in TFVC is the automatic task state management.

It’s no surprise that moving tasks in My Work to In Progress Work moves them to In Progress state in the Web Interface, but it’s nice that checking-in the code associated with a task will move that Task to Done state.

But what’s surprising is that suspending a task in Team Explorer doesn't move it back to TO DO state!


TFVC and TFS offer other features that haven’t been covered here like build definitions and code reviews, so make sure to discover them and use every feature you deem important.

Show your support

Clapping shows how much you appreciated Saif CHAOUACHI’s story.