TFS Pending Changes – Ignoring Files which are Identical to the Originals

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 ? :P

About Nathan Pitman

Undergrad software engineer at the University of Auckland
This entry was posted in Version Control and tagged , , , , , . Bookmark the permalink.

6 Responses to TFS Pending Changes – Ignoring Files which are Identical to the Originals

  1. Sajagi says:

    Thanks for the tip, Nathan. Most appreciated!

  2. Scott Stafford says:

    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”).

  3. Nathan Pitman says:

    Thanks for posting this method, Scott – I knew there had to be a better way! I’ll be using this tomorrow :)

  4. Pingback: Visual Studio TFS shows unchanged files in the list of pending changes | trouble86.com

  5. Scott Stafford says:

    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.

  6. Chai says:

    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’.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>