Visual Studio TFS 在待更改列表中显示未更改的文件

发布于 2024-12-14 00:31:31 字数 108 浏览 0 评论 0原文

我在待更改窗口中看到一个文件。我尝试将其与最新版本进行比较,然后收到一条消息“文件相同”如果文件相同,为什么该文件会显示在待更改窗口中?该文件发生了什么变化?我可以将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

孤君无依 2024-12-21 00:31:31

如果文件由于更改而自动检出,并且最终文件的内容更改回其原始状态,则这是正常的。此时,您会看到经过比较后内容相同的消息。

这篇博客文章描述了一种不太直观的处理方法;在评论中,有一个更好的建议,通过 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...

奶气 2024-12-21 00:31:31

最近我刚刚将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:

  • 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!

心安伴我暖 2024-12-21 00:31:31

为了使上述解释更清楚:

  1. 使用 VS 中的 NuGet 包管理器安装 TFS Power Tools。
  2. 从 Windows“开始”打开 Visual Studio 命令提示符(也称为 VS 2013/2015 的开发人员命令提示符)。
  3. 通过命令提示符导航到本地工作区的根位置。
  4. 执行此命令: tfpt uu 。 /recursive /noget
  5. 如果出现提示,请选择放弃多余的更改。

为我工作。

此外:

有时我发现我需要在导航到工作区文件夹并在那里执行之前在开发人员命令提示符的打开提示符上运行命令(并收到工作区未找到错误)。如果我直接进入正确的文件夹,则找不到该命令。 (我不介意解决该问题本身。)

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

月亮坠入山谷 2024-12-21 00:31:31

我通过单击更改中的 Stage All 按钮,然后使用 Unstage All 取消暂存它们来解决此问题。

它解决了我在 Changes 部分中未更改的文件。又好又简单。

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.

走过海棠暮 2024-12-21 00:31:31

我尝试了这个解决方案,到目前为止它有效。

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:

This solution will still undo the file renaming.

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.

别靠近我心 2024-12-21 00:31:31

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.

我只土不豪 2024-12-21 00:31:31

对我来说,协调工作区可以解决这些无效的挂起更改:

  1. 团队资源管理器 ->构建
  2. 右键单击​​带有更改的最新构建 -> “协调工作空间...”

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..."
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文