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

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

问题描述

令我为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电动工具包括该命令将检出的文件与服务器版本进行比较,并撤消未更改的文件。我将解释如何使用自定义工具将其集成到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,部分解决方法是标记所有文件,右键单击并撤消... ,然后单击 Und o在以下对话框中更改按钮。这将提示您输入不同的文件(让您选择 No No to All ),而不提示没有更改的文件。 重要:我写 partial是因为该方法不适用于文件重命名,因为文件被认为是不变的,因此重命名将被撤消。

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天全站免登陆