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?
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.
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 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 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 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!
To make the above explanation clearer:
- Install TFS Power Tools using the NuGet package manager in VS.
- Open the Visual Studio Command Prompt (also called Developer Command Prompt for VS 2013/2015) from Windows Start.
- Navigate to the root location of your local workspace through the command prompt.
- Execute this command: tfpt uu . /recursive /noget
- 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.)
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 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.
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.
For me, reconciling the workspace resolves these invalid pending changes:
- Team Explorer -> Builds
- Right click on latest build with you changes -> "Reconcile Workspace..."
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.
© 2022 - 2025 — McMap. All rights reserved.