如何从 TFS 2012 签入中永久排除 bin 和 obj 文件夹? [英] How do I permanently exclude the bin and obj folders from TFS 2012 checkin?

查看:39
本文介绍了如何从 TFS 2012 签入中永久排除 bin 和 obj 文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搞砸了 TFS 设置,不小心包含了用于 TFS 2012 签入的 bin 和 obj 文件夹,甚至已经签入了.我不希望这样,因为这些文件经常更改,并不打算包含在内.

I mucked around with TFS settings and I accidentally included the bin and obj folders for TFS 2012 checkin, and even checked them in already. I don't want this because these files change often and aren't meant for inclusion.

我已经检查了 发生了什么Exclude from源代码控制"在 VS2012 中.接受的答案不起作用,因为 bin &obj 文件夹和这些文件夹中的 DLL 不会出现在Promote Candidate Changes"列表中,即使在排除它们之后也是如此.第二个最受欢迎的答案也不能永久有效.我对所有按是,它会将它们从包含的更改列表中删除,但是当我执行任何涉及重建的操作时,它们会再次添加到包含列表中.

I've checked What happened to "Exclude from Source Control" in VS2012. The accepted answer doesn't work because the bin & obj folders and the DLLs inside those folders don't appear in the "Promote Candidate Changes" list, even after excluding them. The second most popular answer also doesn't work permanently. I press yes to all and it removes them from the included changes list, but when I do any action involving rebuilding, they're added to include list again.

我正在寻找一种永久解决方案,该解决方案将从签入中永久排除这些文件夹和其中的文件,并在可能的情况下将它们从 TFS 服务器中删除.

I'm looking for a permanent solution which will permanently exclude these folders and the files inside from checkin, and if possible also removes them from the TFS server.

推荐答案

TFS 2012 可以选择 在您的工作区中放置一个 .tfIgnore 文件.

TFS 2012 has the option to drop a .tfIgnore file in your workspace.

Visual Studio 有一个 UI 可以为您创建文件:

Visual studio has a UI to create the file for you:

虽然您可以使用上述规则手动创建 .tfignore 文本文件,但您也可以在 Pending Changes 页面检测到更改时自动生成一个.

While you can manually create a .tfignore text file using the above rules, you can also automatically generate one when the Pending Changes page has detected a change.

自动生成.tfignore文件

  • 在 Pending Changes 页面的 Excluded Changes 部分,选择 Detected changes 链接.

  • In the Pending Changes page, in the Excluded Changes section, choose the Detected changes link.

将出现提升候选更改"对话框.

The Promote Candidate Changes dialogue box appears.

选择一个文件,打开其上下文菜单,然后选择忽略此本地项目按扩展名忽略按文件名忽略.

Select a file, open its context menu, and choose Ignore this local item, Ignore by extension, or Ignore by file name.

选择确定取消关闭提升候选更改"对话框.

Choose OK or Cancel to close the Promote Candidate Changes dialog box.

一个 .tfignore 文件出现在 Pending Changes 页面的 Included Changes 部分.您可以打开此文件并对其进行修改以满足您的需要.

A .tfignore file appears in the Included Changes section of the Pending Changes page. You can open this file and modify it to meet your needs.

.tfignore 文件会自动添加为包含的待定更改,以便您创建的规则适用于获取该文件的每个团队成员.

The .tfignore file is automatically added as an included pending change so that the rules you have created will apply to each team member who gets the file.

或者使用 echo 从命令行创建它.>.tfIgnore 然后用记事本打开.

Or create it from the command line using echo . > .tfIgnore and then open it using notepad.

另一个技巧是在资源管理器中命名文件 .tfIgnore. 并保存它.如果您想更改扩展名,系统可能会提示您,在这种情况下,答案是:是.

Another trick is to name the file .tfIgnore. in explorer and save it. You'll probably be prompted if you want to change the extension, the answer, in this case, is: yes.

这篇关于如何从 TFS 2012 签入中永久排除 bin 和 obj 文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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