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

7

98

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?

Janssen answered 4/11, 2011 at 15:58 Comment(8)
Perchance is your anti-virus updating the files' last modified date? Or you're working on an encrypted laptop?Endlong
ScottGu explains how antivirus can change these dates waaay down in this article (search for "virus") weblogs.asp.net/scottgu/archive/2006/09/22/…Endlong
This has to be one of THE most annoying TFS "features"Harmonics
I'm having this issue too -- TF works, but TFPT doesn't -- I think it's because I'm using "TFPT - Team Foundation Power Tools 2012" with Visual Studio 2010 workspace... :-/Utrillo
Looks like all I had to do was connect to the same collection in Visual Studio 2012. See this post for more details: #1759106Utrillo
I had this same issue in VS2015. As of VS2015 Update 2, there is the ability to "Stage"/"Unstage" changes (I'm now on Update 3, but I'm sure it's from Update 2). For me, right-clicking the "rogue" file(s) and choosing "Stage" then made TFS realise that there were really no changes and remove them from the list of changed files.Incisure
How do you get a message that says 'The files are identical'? It just shows me the files side by side with no differences, but I don't see any messages about it.Avow
This extension can fix it for VS2017 marketplace.visualstudio.com/…Peplum
O
49

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

Othilie answered 4/11, 2011 at 16:18 Comment(6)
I strongly recommend that you use the tfpt uu power tool and not the hacky "No To All" solution. Only adds and modified edits get this prompt. For example: renames (that are only pended rename, not rename+edit) will be undone by the UI without prompt.Lyssa
In case the original blog post ever goes away, the command is tfpt uu /noget /r *, which must be executed from the root of the branch. Saying this, although it correctly picks up redundant changes, then claims to undo them, I still see them as checked out in VS and in the Check In dialog, so it seems broken for me :/Frye
Another possibility of this happening is if you toggle the "read only" bit of a file without actually changing it's content. TFS can be annoying at times.Network
For reference, the "No To All" solution is copied here from the link: "Another option is to “Undo Checkout” all the changes, and clicking “No to All” when asked to confirm for undo checkout. This way Visual Studio will “undo checkout” all the files that are not changed, and all the changed files will remain checked out. I always use this method."Waziristan
That "No To All" trick is nice, but it has a few drawbacks. For example - I use my tool, to generate DB EntityFramework classes. I generate them in an outside directory, and then just drag them in my solution. Sometimes, when there are no changes, it still displays changes. This "No To All" trick removes them. But if there are new classes added, that were not there before, it removes them from source control - I have to add them back with hand.Anaemic
Installed power tools from https://marketplace.visualstudio.com/items?itemName=TFSPowerToolsTeam.MicrosoftVisualStudioTeamFoundationServer2015Power executed tfpt uu /noget /r * a lot of changes were reverted. Confirmed. And finally in Pending Changes still show not modified files as changed.Rivet
F
17

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!

Frill answered 10/7, 2014 at 16:59 Comment(2)
I have run "tfpt uu . /noget /recursive", and it claims there are no redundant pending changes in the workspace. VS2015, TFPT 2015. All of my changes are empty [merge] changes.Frogmouth
I had tried this with no success. Removing the point of the argument seems to make it work properly: uu /noget /recursiveTellurium
P
10

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

Pape answered 30/11, 2015 at 16:1 Comment(6)
Thanks me-from-november-30th-2015. I keep getting the same issue time and time again and your answer was perfect. I tried to up vote you, but got some kind of 'space-time continuum' error. Something to do with November 30th 1955 and "required 1.21 gigawatts not found".Pape
Unfortunately not working for me. Unable to determine the workspace. Already tried updating the workspace cache, no success. After 2 hours I'll just give up and check in the not changed files to get rid of them.Strengthen
@C4u I may have started experiencing that one myself, since moving to VS 2015. However, the issue with checked-out files occurring has gone away. I'll see what I can find out.Pape
I was not able to find the PowerTools using NuGet, but was able to find and install it via a google search "Microsoft Visual Studio Team Foundation Server 2013 Power Tools"Somnambulism
@Versatile Looking at Visual Studio 2017, you would need to go to 'Tools' > 'Extensions and Updates...' I don't remember the menu structure in 2013/15. Maybe my answer requires correction. If you have VS 2013/15 and can check the menu structure, please feel free to do an edit on my answer. :)Pape
It seems it will not work for VS2019. Currently there is no power tools for VS 2019.Baecher
L
1

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.

Lightless answered 30/1, 2017 at 15:49 Comment(0)
U
0

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.

Unaccountable answered 23/12, 2015 at 10:51 Comment(1)
My workspace is local, but the unchaged files still appear in pending changes... It doesn't automatically undo the check-out...Krutz
R
0

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..."
Roam answered 12/9, 2018 at 18:26 Comment(0)
M
0

I tried this solution and it works so far.

UTC May 8, 2024, on Visual Studio 2022 17.9.2

I've found this : TFS undo checkout of unedited files

This article says that you just need to "Undo pending changes" on checkout files. When undo to a first "actually edited" files, will pop up a asking window to ask you "if you want to discard the changes". Select "Not to all" and all unedited files will be undo the checkout, and leaving all the files you actually edited.

If you have concerns about this solution or are worried that changes will be lost due to misoperation, you can first copy to back up the code you will undo changes.

Mallett answered 8/5, 2024 at 9:44 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.