Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

check out TFS at a specific change set

Tags:

I'm using TFS and VS 2012 and my project is in a broken state and I can't figure out why. I'd like to go back to a previous version of my solution when I know it worked and make changes on that working version. However, when I choose to check out a specific changeset, it seems to me like it's only changing the files that were changed in that changeset. When I use git and check out a revision, my code looks exactly like it did at that revision. Files that didn't yet exist at that revision are removed, files that did exist have contents as they were at that revision, etc. But I can't seem to do the same in TFS. I can't figure out how to get all of the files (and only the files) in the state that they existed when a particular changeset was checked in. Am I missing something? Any help REALLY appreciated.

like image 700
cabird Avatar asked Nov 20 '13 04:11

cabird


People also ask

How do you check changes in TFS?

Find a changeset by IDIn Source Control Explorer, press Ctrl + G. The Go to Changeset dialog box appears. Type the number of the changeset and choose OK. If you don't know the number, choose Find.

What is Checkout for edit in TFS?

In rare situations (for example, you want to check out and lock the file to make sure your changes are checked in before changes from other team members), you might need to manually (right click -> check out for edit) check out (and optionally lock) an item.

How do I get a new changeset number in TFS?

If you don't know the number, to find a changeset, In Source Control Explorer, on the menu bar, File => Source Control => Find => Find Changesets. The Find Changesets dialog box will appear.

How do I check my TFS history?

Right-Click If you have the Source Control Explorer or File List open, right-click the file you want to view and select Source Control > View History. Local Toolbar In the File List, select the file(s) you want to view. In the local toolbar of the File List, click , then select View History .


2 Answers

Try using the Advanced option when you right click on a solution or folder in Source Control:

Advanced option when you right click on a specific file or folder in Source Control

Then when the dialog appears, check both check boxes so the version you have is overwritten with the specific version you want by selecting Changeset from the ddl and entering the changeset you are after...

dialog from VS2012 to get specific version based on changeset

This should overwrite the existing solution files with the specific version.

If you have trouble doing it over top of existing files, delete the source on your local machine first and get the specific version after that.

like image 196
CodexNZ Avatar answered Oct 26 '22 00:10

CodexNZ


A changeset is just the files checked in at one time, not a snapshot of the whole system. You want to use labels for that. A label will mark all the files in their present state, just as you describe Git doing.

like image 44
Engineer Avatar answered Oct 26 '22 00:10

Engineer