31

When you right click on a file and select "Compare...", you get a few different options:

  1. Changeset
  2. Date
  3. Label
  4. Latest Version
  5. Workspace Version

The first 3 are pretty self explanatory. But what is the difference between the latest version and workspace version? 4 seems like you are comparing the code on your machine to the latest version in TFS 5 - shouldnt this be just like (4)? (I thought it might allow you to compare against multiple workspaces, but the dialog doesnt seem to have an option to select a different works space.)

Raj Rao
  • 8,872
  • 12
  • 69
  • 83
  • 5
    I've been using it for over a year and have ignored the workspace version because it made no sense to me. TFS needs an SCCS-Engineer to Normal Human translator. – Greg Jul 26 '10 at 19:08

4 Answers4

53

THe difference that I have found between Latest Version Workspace Version

Latest version - compares your current code file with the most current code file on TFS server. (This includes all the changes made by your fellow code monkeys and checked back in since you checked out the file). This form of comparison will show differences only if you have multiple checkouts enabled.

Workspace Version - compares your current code file against the code at the time that you had checked out the file. If you have multiple checkouts enabled and some of your fellow code monkeys have checked in changes - then, you use this option to see what you originally changed. You then will have to compare against the latest version to see if there will be any conflicts while you are checking in your code file.

Raj Rao
  • 8,872
  • 12
  • 69
  • 83
11

Latest Version refers to the last version that was committed to the TFS Source Control while Workspace version refers to the last checked-in version in your local workspace.

So basically the Workspace version Compare will will compare the file(s) you are comparing with your checked in files. While the Lastest Version Compare will compare it against files that may have been checked in by someone else on your team.

Robert Kozak
  • 2,043
  • 17
  • 33
  • So what happens if I have not checked in my code and I have never edited that file before. What does the workspace version compare against? (As I have no files checked in and I wish to check the file I currently have checked out and made edits to). Very confusing.... – Raj Rao May 08 '09 at 22:16
  • It will compare your version with the clean version in TFS without any other checked in versions from when you last got latest. – Robert Kozak May 08 '09 at 22:38
2

The confusion between Latest-Version and Workspace-Version mainly comes (for me) on what you think you're clicking on. When you click on the file in Source Control view or in Pending Changes, TFS treats it as if you're clicking on the file in source control that you last synced to, not the local file.

Most of the time Latest-Version probably won't be used as (I assume) you'll be synced to latest most of the time.

Martin
  • 3,396
  • 5
  • 41
  • 67
Herms
  • 37,540
  • 12
  • 78
  • 101
1

As i read on another question on stackoverflow (What is the difference between "Compare with Workspace version" and "Compare with Latest version"?) my explanations are below (please correct if i am wrong)

Compare with latest version: Compares your file (edited or not edited), with the most current version in TFS server

Compare with workspace version: Compares your file (edited or not edited), with the version you checked-out to your workspace before starting your work.

Community
  • 1
  • 1
sulutas81
  • 21
  • 5