Thursday, February 14, 2008

TFS - Getting files that have changed since a particular date

One of the most annoying parts of source control in visual studio is the lack of some basic features that are in other source control systems. One such feature is to get files that have changed since a particular date. You can do this in TFS, but it isnt straightforward.

Here is how you do it:

1. Create a new folder on your local hard drive to be used temporarily.

2. In visual studio, create a new workspace mapping the directory in source control you want to get the changes on, to the folder created in step 1 above.

3. Under source control, right-click on the folder and select "Get Specific Version..." on the directory that you want to get the changes on.

4. From the Version checkbox, choose "Changeset" and enter the changeset that has the files without the changes you are retrieving.

5. Click Get to get all the files.

6. Once complete, go to the directory on your local hard drive (created in step 1) and delete all the files you just retrieved.

7. Under source control, right-click on the folder you wish to get the changes on and select "Get Latest Version"

After all the files are done downloading, your local folder will only have files that have changed since you last retrieved the files in step 3. Why? - "Get Latest Version" doesnt actually look at the files on your local machine to determine what files need to be updated. Instead, it keeps track of the files you downloaded on the server and gets any changes from your previous download.

No comments: