Visual Studio TFS shows unchanged files in the list of pending changes

Visual Studio-2010Tfs

Visual Studio-2010 Problem Overview


I see a file in pending changes window. I try to compare it with latest version and I get an a message 'The files are identical' If the files are identical why is this file showing up in pending changes window? What changed about this file? Can I configure TFS not to list files that are identical?

Visual Studio-2010 Solutions


Solution 1 - Visual Studio-2010

This is normal if a file becomes automatically checked out due to a change, and if ultimately the contents of the file are changed back to it's original state. At that point you would see the message about identical contents upon comparison.

This blog entry describes a not-so intuitive way of dealing with this; and in the comments there is an even better suggestion on dealing with it through the command line via TFS power tools.

TFS pending changes ignoring identical files...

Solution 2 - Visual Studio-2010

Recently I just updated VS2010 to VS 2013, and this issue even worse. When you use compare, files that are identical don't pop up at all. I hate this because you could not figure out which files are truly changed until you check the compare files carefully.

Finally I figure out a workaround for this:
Add "Undo unchanged checkouts" in the external tools:

  • Command: tfpt.exe
  • Arguments: uu . /noget /recursive
  • Initial directory: $(SolutionDir)

After running this command, TFS will automatically undo all the redundant changes in the files.
But these files still keep check out status, actually they are already undo and same as the latest version. I think It is a bug in TFS. You just need click Refresh icon in the toolbar under solution explorer, these files will be refreshed and show the correct status!

Solution 3 - Visual Studio-2010

To make the above explanation clearer:

  1. Install TFS Power Tools using the NuGet package manager in VS.
  2. Open the Visual Studio Command Prompt (also called Developer Command Prompt for VS 2013/2015) from Windows Start.
  3. Navigate to the root location of your local workspace through the command prompt.
  4. Execute this command: tfpt uu . /recursive /noget
  5. Choose to discard redundant changes if prompted.

Worked for me.

Further:

Sometimes I have found I need to run the command on the opening prompt of the Developer Command Prompt (and getting a workspace not found error), before navigating to the workspace folder and executing there. If I go straight to the correct folder, the command is not found. (I wouldn't mind a solution to that issue in itself.)

Solution 4 - Visual Studio-2010

I solved this by clicking the Stage All button in Changes then unstaging them with Unstage All.

It resolved the unchanged file I had in my Changes section. Nice and simple.

Solution 5 - Visual Studio-2010

Visual Studio 2012 introduced a new concept called Local Workspace.

When the Workspace Location is configured to be Local, then it will place a local copy of the original file (Just like SVN / CVS).

It will then automatically hide unchanged files from pending changes.

Use the TFS Source Control Explorer to "Edit..." the TFS Workspace, and change the "Advanced..."-setting Location from Server to Local.

Solution 6 - Visual Studio-2010

For me, reconciling the workspace resolves these invalid pending changes:

  1. Team Explorer -> Builds
  2. Right click on latest build with you changes -> "Reconcile Workspace..."

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questiondev.e.loperView Question on Stackoverflow
Solution 1 - Visual Studio-2010enablorView Answer on Stackoverflow
Solution 2 - Visual Studio-2010zmaggieView Answer on Stackoverflow
Solution 3 - Visual Studio-2010PhilView Answer on Stackoverflow
Solution 4 - Visual Studio-2010Tom 'Blue' PiddockView Answer on Stackoverflow
Solution 5 - Visual Studio-2010Rolf KristensenView Answer on Stackoverflow
Solution 6 - Visual Studio-2010AnonyMouseView Answer on Stackoverflow