some sample command-line usages of tf.exe


A customer had asked about how to do some specific operations with the command-line.  Our own DougN responded, and I wanted to include his examples here for others.


Baseless merging from one branch to another:


tf merge /recursive /baseless $/TeamProject/SourceBranch $/TeamProject/TargetBranch


 



Generate a list of labels that start with the text “Release”:


tf labels Release*


 



Generate a list of labels that start with the text “Release” and what files are in those labels:


tf labels /format:detailed Release*


 



Show the branch ancestry of a folder called $/TeamProject/Branch


tf branches $/TeamProject/Branch


 



Show a list of changesets that need to be merged between two branches


tf merge /candidate /recursive $/TeamProject/SourceBranch $/TeamProject/TargetBranch


 



Show a list of changesets that have already been merged between two branches


tf merges /recursive $/TeamProject/SourceBranch $/TeamProject/TargetBranch


 



Show a list of files that would be effected in a given merge operation


tf merge /preview /recursive $/TeamProject/SourceBranch $/TeamProject/TargetBranch


 


Show a list of changesets and included files that have been checked in since changeset 5000 under $/TeamProject:


tf history /format:detailed /recursive /version:5000~T $/TeamProject


 


Comments (2)

  1. Buck Hodges blogs about TFS Alerts: From address and filtering.

    Charles Sterling talks about upgrading…

  2. If you are going to be doing more than the basic check-in / check-out options then it pays to get to know the command line client – tf.  The command line client is actually the most flexible and powerful client…