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 ?



Thanks for the tip, Nathan. Most appreciated!
This same thing can be done a little less dangerously with TF power tools on commandline:
C:\MyBranchRoot > tfpt uu /r *
“uu” is “undo unchanged”, “Undo changes to unchanged files in the workspace”.
tfpt can be gotten from http://msdn.microsoft.com/en-us/vstudio/bb980963?ppud=4.
This command also effectively does a “Get Latest”, so I always use this instead of Get Latest (or “tf get . /r”).
Thanks for posting this method, Scott – I knew there had to be a better way! I’ll be using this tomorrow
Pingback: Visual Studio TFS shows unchanged files in the list of pending changes | trouble86.com
Do add to my previous post, the /noget parameter might be more exactly what the OP asked for:
tfpt uu /noget /r *
will update WITHOUT doing a Get Latest — just undoing any meaningless checkouts. As an aside, if you run this right before doing tfpt uu /r *, you’ll avoid some irritating possible conflicts.
I noticed that when the pending changes tab have some changes related to deletion of files, they are all rolled back when you follow this process.The only change type left after this process is ‘edit’.