What is the difference between “Compare with Workspace version” and “Compare with Latest version”?

后端 未结 4 1361
生来不讨喜
生来不讨喜 2021-02-01 00:15

I am using Visual Studio 2012 with TFS. Whenever I want to compare my checked out files, I have two options to choose from:

  1. Compare with workspace version
相关标签:
4条回答
  • 2021-02-01 00:30
    • Comparing with workspace version actually compares the edited file with the version of file at the time you checked out (compares exclusively your changes).

    • Comparing with latest version compares the edited file with latest version of file present at your code repository i.e. it might include changes made by your colleagues.

    http://codereferences.blogspot.ca/2012/03/tfs-compare-with-workspace-version.html

    0 讨论(0)
  • 2021-02-01 00:30

    @serhio's 3/28/14 answer is an excellent narrative answer. However, I'm sure many (including myself) needs that backed-up with an example, and here it is:

    1. For everyone, "Lastest Version" = Changeset # 1.
    2. You "Get Latest".
    3. For you, "Workspace Version" = Changeset # 1.
    4. You make changes.
    5. Developer B "Get Latest".
    6. For Developer B, "Workspace Version" also = Changeset # 1.
    7. Developer B makes changes.
    8. Developer B "Check-in".
    9. For everyone, "Lastest Version" = Changeset # 2.
    10. For Developer B, "Workspace Version" = Changeset # 2.
    11. For you, "Workspace Version" still = Changeset # 1.
    12. You "Get Latest", "Merge Conflicts" (if necessary) and "Check-in".
    13. For everyone, "Lastest Version" = Changeset # 3.
    14. For you, "Workspace Version" = Changeset # 3.
    15. For Developer B, "Workspace Version" still = Changeset # 2.
    0 讨论(0)
  • 2021-02-01 00:38

    Compare with Latest version seems clear. It compares files against the latest version in TFS. So you'll get all the differences between the very latest version checked into source control and whichever folder you're comparing against.

    Compare with Workspace version might be confusing, but is actually pretty simple. TFS keeps track of the version of the file which you've retrieved into your workspace. This is usually the latest version, or pretty close to that, but that doesn't have to be the case.

    When using the Get Specific Version option you can retrieve any version of a file to your local workspace. You can even retrieve files from different versions into your workspace. When you select this option, a comparison will be done against the version that is currently in your workspace.

    Compare screen

    0 讨论(0)
  • 2021-02-01 00:55

    To restate the Answer:

    The local file is always the one you are working on.

    The server file can either be:

    1. The latest version including all other check-ins. (You see your changes, as well as other peoples changes.)

    2. The Version as it was when you checked it out (You see only your changes, even if other people have checked in since).

    If no other people check in files since your checkout, then the both of the above produce exactly the same result.

    So if you want to compare what you have done against what it was when you started, select Workspace Version

    If you want to compare what you have done against what other people have done, select Latest Version

    0 讨论(0)
提交回复
热议问题