Visual Studio TFS 在待更改列表中显示未更改的文件
我在待更改窗口中看到一个文件。我尝试将其与最新版本进行比较,然后收到一条消息“文件相同”如果文件相同,为什么该文件会显示在待更改窗口中?该文件发生了什么变化?我可以将 TFS 配置为不列出相同的文件吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
如果文件由于更改而自动检出,并且最终文件的内容更改回其原始状态,则这是正常的。此时,您会看到经过比较后内容相同的消息。
这篇博客文章描述了一种不太直观的处理方法;在评论中,有一个更好的建议,通过 TFS 电动工具通过命令行处理它。
TFS 挂起的更改忽略相同的文件...
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...
最近我刚刚将VS2010更新到VS 2013,这个问题更严重了。
当您使用比较时,根本不会弹出相同的文件。我讨厌这个,因为除非你仔细检查比较文件,否则你无法弄清楚哪些文件真正被更改。
最后我找到了解决方法:
在外部工具中添加“撤消未更改的签出”:
tfpt.exe
uu 。 /noget /recursive
$(SolutionDir)
运行此命令后,TFS 将自动撤消文件中的所有冗余更改。
但这些文件仍然保持签出状态,实际上它们已经被撤消并且与最新版本相同。我认为这是 TFS 中的一个错误。您只需单击解决方案资源管理器下工具栏中的刷新图标,这些文件将被刷新并显示正确的状态!
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:
tfpt.exe
uu . /noget /recursive
$(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:
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.)
我通过单击更改中的
Stage All
按钮,然后使用Unstage All
取消暂存它们来解决此问题。它解决了我在
Changes
部分中未更改的文件。又好又简单。I solved this by clicking the
Stage All
button in Changes then unstaging them withUnstage All
.It resolved the unchanged file I had in my
Changes
section. Nice and simple.我尝试了这个解决方案,到目前为止它有效。
UTC 2024 年 5 月 8 日,Visual Studio 2022 17.9.2
但警告:
我发现了这个:TFS 撤消未编辑文件的签出< /a>
本文说您只需要在签出文件上“撤消挂起的更改”。当撤消第一个“实际编辑”的文件时,会弹出一个询问窗口询问您“是否要放弃更改”。选择“不全部”,所有未编辑的文件将被撤消检出,并保留您实际编辑的所有文件。
如果您对此解决方案有疑虑或者担心由于误操作而导致更改丢失,您可以先复制备份您将撤消更改的代码。
I tried this solution and it works so far.
UTC May 8, 2024, on Visual Studio 2022 17.9.2
But WARNING:
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.
Visual Studio 2012 引入了一个名为本地工作区。
当工作空间位置配置为本地时,它将放置原始文件的本地副本(就像 SVN / CVS)。
然后,它会自动隐藏未更改的文件以防止挂起的更改。
使用 TFS 源代码管理资源管理器“编辑...”TFS 工作区,并将“高级...”设置位置从服务器更改为本地。
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: