TFS11 (vNext): Local Workspaces

This is the next part in my series of TFS vNext posts:
Part 1: The My Work Tab
Part 2: Pending Changes
Part 3: Code Review

Local Workspaces is a new feature in TFS11.  Fundamentally, it is the biggest change that existing TFS developers developers will feel as they interact with this new version.

In TFS 2010 and previous versions, workspaces were “server” workspaces, which means that the server has the master copy and the server must be notified before any change is made to a file.  This is known as an “Edit-Merge-Commit” style and it’s typical of a server-centric solution. 

TFS11 introduces Local Workspaces which moves the ownership of the workspace (and its files) to the client and it’s up to the server to accept changes made on the client.  This style is called “Modify-Merge-Commit”.  The first thing that people will notice is that when you get latest, the the files are no longer read-only and the moment that you start making changes to them, Visual Studio will be aware of the changes.  The important thing here is that the TFS server does not need to be notified of these changes, which also means that our offline experience will be much better.  This is how SVN works as well.

It is important to note that Local Workspaces is the new default, so there is nothing that you need to do to make this happen.  Let’s take a look at the “New Workspace dialog” (on Advanced mode):
image
The Location drop-down shows us the available options of “Local” and “Server”, with Local being the default.  I could not find a way to switch a workspace from Local to Server or vice versa, so you’d need a new workspace if you want to change the mode.

Once you start making file changes in your local workspace, you can compare against your workspace version, undo checkout, and other version control operations, even if you are disconnected.

So internally, how does this work?
On your file system, at the root level of your workspace, a hidden folder named $tf is created:
image

Inside of that folder, TFS caches your workspace version and manages all the changes that will be sent to the server.  It’s similar to what SVN does, but it doesn’t have hidden folders all over the place, just one at the root.
Digging into $tf:
image
And digging further:
image

So there you go…Local Workspaces!

You can visit Brian Harry’s blog for additional reading on this: http://blogs.msdn.com/b/bharry/archive/2011/08/02/version-control-model-enhancements-in-tfs-11.aspx

About esteban

Esteban is the Founder and Chief Technologist at Nebbia Technology, an ALM consulting and Azure-powered technology company. He is a software developer with a passion for ALM, TFS, Azure, and software development best practices. Esteban is a Microsoft Visual Studio ALM MVP and ALM Ranger, Pluralsight author, and the president of ONETUG (Orlando .NET User Group).

2 thoughts on “TFS 2012 Update 2: Version Control Changes

  1. social media marketing plan sample

    Hello. I uncovered the blog page the use of bing. That is an exceptionally smartly composed write-up. I’m going to make sure to save this and are avalable time for get more information within your helpful information. Appreciate the particular write-up. I’m going to certainly go back.

  2. Ramesh

    I am getting following error at “CreateBranch” method, can you pls suggest?

    You cannot call a method on a null-valued expression


Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human? *