Since posting about TFS a few weeks ago, I noticed I’ve received a lot of Google traffic in relation to a specific TFS annoyance I mentioned; the fact that when you view pending changes or check in files for a solution, it presents you with a slew of files that you’ve checked out at some stage, but haven’t actually modified. If you do a Compare on them, TFS will tell you “The files are identical”. Well since then, I’ve figured out how to purge these unwanted squatters – it’s just kinda unintuitive. Here’s how:
1.) First go to your Pending Changes and select Undo on any of the files. In this case, main.cpp is the only file with any real modifications; a.h and b.h haven’t been changed.
2.) An Undo dialog will pop up. Check all of the files and hit Undo Changes.
3.) When this confirmation dialog pops up, make sure you hit No to All.
And as a result, TFS will go through and undo checkouts for any unchanged files whilst leaving your modified files untouched. Now wasn’t that glaringly obvious ? 😛