Getting History from TFS
November 21, 2010 Leave a comment
I recently needed to get a list of all changes to a project checked in to Team Foundation Server’s source repository between two dates. By opening the TFS Source Control Explorer, right-clicking on the desired project name, and selecting View History, I was able to get a list of every changeset for that project. Double-clicking on a changeset produced a dialog that showed each file that is part of the changeset.
This is useful, but only allows viewing of one changeset at a time, and I needed a way to view all of the changesets and files at one time.
I found a post on Stack Overflow (http://stackoverflow.com/questions/922736/tfs-show-modification-new-and-edited-files-since-a-given-date), which proved to be exactly what I needed.
It shows how to use the TF.EXE utility to produce a report on changesets between two dates. On my computer, TF.EXE was not in the path, so I first had to navigate to C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>
From there, I ran the following command (all on one line):
tf history -noprompt -server:http://SERVER:8080 $/PROJECTNAME -version:D2009-10-23T01:01:01Z~D2010-11-30T01:01:01Z -recursive -format:detailed -login:DOMAIN\USERNAME,PASSWORD
The output looked something like this (repeated for each changeset):
Date: Thursday, October 28, 2010 2:20:47 PM
Added "GetUnpublished" methods to the API.