Welcome to MSDN Blogs Sign in | Join | Help

Why "Get Latest" sometimes doesn't...

I've seen quite a bit of angst from new TFS users over the "Get Latest Version" behavior in Team Foundation Server source code control, so I think it's worth a bit of discussion.

The most common issue people report is that issuing the "Get Latest Version" doesn't actually bring the latest version of the file down from the server when the local copy has been deleted for some reason (intentionally or otherwise). 

It may surprise you at first, but this is actually the intended behavior of TFS!  TFS stores information on the server about which versions you have "gotten" to your local workspace.  We do this to reduce the amount of files you have to copy down when you issue a "get latest" from the top level of your project as most people do.  This speeds up your "get" significantly by only refreshing the items in your workspace that have changed on the server.  Imagine if you had a large project and the server always sent you the latest version of every file even if you had it on your disk already.  You'd be sitting around twiddling your thumbs for a long time while you waited for the server to give you what you already have.  That's not productive, right?  ;)

Of course, there are ways to "fool" any system.  In this case, you can fool TFS either by marking a local file as writeable without actually checking it out or by deleting a local copy of a file without pending a "delete" command to TFS.  In both of these cases, the server has no idea that you've modified or deleted your local files.  If doing this on a regular basis is part of your normal workflow, I'd love to hear more details about why you do this.

So how do you really Get Latest?

From the UI (i.e. Solution Explorer or the Source Control Explorer)

1.  Right click on the item(s) you want to get and click Get Specific Version

2.  In the dialog that pops up, check the appropriate checkbox for your situation:

  • If you've marked a local copy writeable without actually checking it out, and if you don't care about losing any changes to the file, check "Overwrite writeable files that are not checked out"
  • If you've deleted a local copy and want to get it back, check "Overwrite all files even if the local version matches the specified version"

Get Specific Version dialog

If these still don't help, post comments here or post questions in the MSDN forums and we'll help you out.

Here are some other discussions of the Get Latest behavior:

 

Published Thursday, August 28, 2008 9:21 AM by JasonBa

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

Friday, August 29, 2008 12:45 PM by Team System News

# VSTS Links - 08/29/2008

Willy-Peter Schaub on TFS 2008 Service Pack 1 - Caution with database backups! Jason Barile on Why "Get...

Thursday, September 04, 2008 1:07 PM by Bertrand

# re: Why "Get Latest" sometimes doesn't...

As an additional note, In the latest power tool you can also use the "scorche /deletes" command to synch up quickly.

Tuesday, September 09, 2008 2:40 PM by DotNetKicks.com

# Why

You've been kicked (a good thing) - Trackback from DotNetKicks.com

Thursday, October 02, 2008 12:18 PM by Henry

# re: Why "Get Latest" sometimes doesn't...

I understand the reasoning behind having TFS record my version of the file, but I like the Subversion approach better. It keeps a hidden '.svn' folder that keeps track of this for me. (Also helps in working off-line)

Subversion also will replace any missing files that I have removed (accidental or other) when I simply get latest, I would not have to get a specific version.

I am trying to love TFS but it is hard when features I am used to are missing or work differently

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker