Tuesday 7 May 2013

TFS History command


Command to retrieve tfs history


Get me all things what we have worked on within last month.
I know that there is a command: "TF HISTORY"  with basic implementation below

tf history  $/Project/development /collection:http://tfs01:8080/tfs/DevelopmentServices/
Where:
1.      $/Project/development – Project against which you want to run report
2.      /collection:http://tfs01:8080/tfs/DevelopmentServices/ -  Tfs collection

Finally add options:

/noprompt
This option:
·         Suppresses the display of windows and dialog boxes (such as the History window) and redirects output data to the command prompt. See Team Foundation Version Control Command Reference.
·         Does not display the history of revisions that occurred before an item was moved, renamed, branched, or merged.

 tf history  $/Project/development /collection:http://tfs01:8080/tfs/DevelopmentServices/ /noprompt
This had disabled popups
  /user:username
Filters the historical data to show changes made by the specified user. An asterisk (*) symbol includes data on changes from all users (the default).
 tf history  $/Project/development /collection:http://tfs01:8080/tfs/DevelopmentServices/ /noprompt /user:*

This selected all users for history
/recursive
Recursively retrieves historical data on items in the specified directory and any sub directories.
 tf history  $/Project/development /collection:http://tfs01:8080/tfs/DevelopmentServices/ /noprompt /user:* /recursive
Suddenly I have all changesets
/format
Specifies how much detail to display about each changeset when the /noprompt option is specified:
·         Brief (default): Displays one line about each changeset that includes: ID number, changes made, user who made the changes, date, and comment. Some of the data may be truncated.
·         Detailed: Displays a full description of each changeset. In addition to the above information, this option displays additional data such as date with time, items changed, check-in notes, and check-in policy warnings.

 tf history  $/Project/development /collection:http://tfs01:8080/tfs/DevelopmentServices/ /noprompt /user:* /recursive /format:brief
This gets level of detail displayed about changesets

Final Command

tf history /noprompt $/Project/development /collection:http://tfs01:8080/tfs/DevelopmentServices/ /format:brief /v:D"01/05/2013"~D"05/08/2013" /user:*  /recursive

Resource for this article is of course MSDN

No comments:

Post a Comment