开发者

How to check files against TFS without getting latest?

While reconciling an old solution I have been getting historical file versions from TFS without checking out.

That is, for a bunch of files in my solution I did "Sho开发者_JAVA技巧w History" > "Get This Version"

Now I have all the mix-and-match of historical versions I want, but I did not keep track of which files (and which versions of the files) I got which were not latest.

Is there a way I can get a list of "not latest" files in my solution? That is, I want the output window's list of replaced files if I were to execute a "get latest" but I do not actually want to get them.


Right click on the top level folder in Source Control Explorer, select "Compare". Top option should be the server path e.g. $/TeamProject/Myfolder with the latest version selected in the dropdown. The bottom option should be c:\MyWorkspace\TeamProject\Myfolder this will do a compare with the latest version held in TFS with the files you have locally.

How to check files against TFS without getting latest?

How to check files against TFS without getting latest?

Or you could do the same thing using the tf diff command line tool.


You can do a "preview get" from the command line: tf get /recursive /preview will output the list of files that it would do a get of to update you to the latest version.


If you're familiar with Powershell, you should be able to take this approach:

  • Ensure Team Foundation Power Tools are installed
  • You may need to re-run the installer as the TF Powershell cmdlets don't install by default
  • Open up powershell in x86 mode (x64 causes weirdness with said cmdlets)
  • Add-PsSnapin Microsoft.TeamFoundation.Powershell
  • Navigate to your workspace root
  • Get-TfsItemProperty * -recurse | where { $_.IsLatest -eq $false } | format-table
  • Optionally, add "> staleList.txt" to pipe the output to a file.

Hope this works!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜