This is a mirror of official site: http://jasper-net.blogspot.com/

TFS Guide for Subversion Users

| Wednesday, January 19, 2011
Moving from one source control system to another is much like moving to a new town.  You spend time finding where to get the same services in the new town, discovers what’s different, what’s new, and what is not available.   In this blog post I’ll take a similar approach to explore what it is like to move from Subversion town to TFS town.  I’ll use SVN terminology where it makes sense so you can quickly find TFS equivalent terms.

The TFS way to do a given Subversion Task

Importing Code

Subversion has an import command to add files and folders to an SVN repository.  Once a folder structure is created, files and folders can be added using svn add.  TFS does not have a separate import and add operation – instead it is all done with the tf add command.  TFS does require a workspace (think working copy directory mapping) to be defined to map local folders to server folders.  In Visual Studio the workspace is created automatically for you if you drag and drop files onto Source Control Explorer or if you add an existing solution to Source Control.  

To do this from the command line in TFS you do the following:

  1. cd into the top level folder you want to add
  2. Create a workspace - tf workspace /new
  3. Select the server path you want to add the folder to in the dialog
  4. Press OK
  5. Pend the add of the folder and it’s contents recursively by performing the following command.  tf add .\ /r
  6. tf checkin

SVN Checkout and TFS Checkout are NOT the Same

One area of confusion for users moving from SVN is the term checkout.  SVN checkout is the way to pull files and folders from the SVN repository to create a working copy locally.  You typically only do this once and when you want later revisions you run svn update.   The TFS equivalent of SVN checkout is creating a workspace mapping and performing a tf get which will copy the files from the server into the local files you defined in the workspace.

A TFS checkout is completely different than the SVN checkout command.  TFS checkout is the way the user tells TFS they plan to make a change to a file.   TFS checkout changes the file’s attributes from read-only to writable.

SVN Update

The update command is used to get the latest or a specific revision from the SVN repository to the working copy.  The TFS get command accomplishes the same thing.   However, there are a few key differences on behavior.

  1. SVN will look for missing files and place them in the working copy.  TFS does not do this.
  2. SVN pulls down an extra copy of the file and places it in the .svn directory.  TFS does not pull down an extra copy which means the space on disk that a TFS workspace takes is at least 1/2 the space that SVN uses.
  3. SVN pulls down files as writable while TFS pulls down files that are not checked out as read-only

SVN Commit

SVN commit (aka ci) is the equivalent of tfs checkin.  Where they differ is

tfs checkin has many additional features (see New Things you can do in TFS section below)
After the checkin tfs makes the file read only while svn leaves the file writable


Read more: Ed Hintz (MSFT)

Posted via email from .NET Info

0 comments: