Clean TFS Workspaces with Scorch & Treeclean

If you’ve been working with a TFS workspace for a long time, you know it can get filled up with all kinds of built objects and temporary files. There’s a super-easy way to clean-up using the TFS PowerTools, though.

Check out these two commands:

  • tfpt scorch – Ensure source control and the local disk are identical
  • tfpt treeclean – Delete files and folders not under version control

(Taken from this MSDN forum post.)

7/2/2013 Update:
A co-worker and I were reviewing the scorch command and whether or not pending changes will be deleted through its use. That concern is addressed directly in the help text for the command, accessed by running tfpt scorch /? from the command prompt. Note the last line in the excerpt below, highlighted in red.

Items not in source control will be deleted from disk, just as with the tfpt treeclean command. Items determined to be different on disk from the workspace version will be redownloaded from the server. Items missing on disk will also be redownloaded. Items with pending changes are exempted.

So, it is safe to use scorch while you have pending changes; they will simply be ignored.

%d bloggers like this: