如何撤消未更改的文件的挂起更改? [英] how to undo pending changes of files that are unchanged?

查看:32
本文介绍了如何撤消未更改的文件的挂起更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我对 TFS 感到抓狂的一件事是,如果您签出一个文件,但您没有对其进行任何更改,它仍然显示为更改,从而分散您对所做的实际更改的注意力.这在您使用 T4 等工具生成代码时尤其烦人,因为大多数情况下,该工具会生成相同的代码,但会将文件签出.

One thing that drives me crazy with TFS is the fact that if you have a file checked out, but you made no changes to it, it still shows as a change, distracting you from real changes that you made. This is especially annoying when you use tools such as T4 to generate code, because most of the time the tool will generate the same code, but will leave the file checked out.

出于某种我无法理解的原因,Visual Studio 坚持将这些显示为更改,并且如果另一个人碰巧签入相同的更改",甚至会声称存在冲突.

For some reason that I can't understand, Visual Studio insists in showing those as changes, and will even claim that there are conflicts if another person happened to check-in the same "changes".

幸运的是,TFS Power Tools 包含一个比较使用服务器版本检出文件并撤消未更改的文件.我将解释如何使用自定义工具将其集成到 Visual Studio 中.

很遗憾,如果您使用的是 Visual Studio 2017,则此功能不可用!

它曾经是 非常简单 使用早期版本的 Visual Studio 完成此操作:

It used to be very simple to accomplish this with earlier versions of Visual Studio:

tfpt uu /noget /r *

如果文件没有任何更改,我们如何从挂起的更改中删除它们?

推荐答案

这取决于你在 TFS 中选择的版本控制系统,所以上述问题只存在于 TFS 的传统版本控制系统 TFVC 而不是 git 有已经支持几年了.

This is different based upon your choice of version control system in TFS, so the above problem only exists for TFS' traditional version control system TFVC and not git which has been supported for a few years now.

对于 TFVS,部分解决方法是标记所有文件,右键单击并撤消...,然后单击以下对话框中的撤消更改按钮.这将提示您输入不同的文件(让您选择 NoNo to All),但不会提示没有更改的文件.重要:我写部分"是因为这种方法不适用于文件重命名,因为文件被视为未更改,因此重命名将被撤消.

For TFVS a partial workaround is to mark all files, right-click and Undo... and click Undo Changes button in the following dialog. This will prompt you for the files that are different (letting you choose No or No to All) but not for the ones that have no changes. Important: I write 'partial' because this approach does not work for file renames as the file is considered unchanged so the rename will be undone.

这篇关于如何撤消未更改的文件的挂起更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆