如何从 TFS 源代码管理中排除特定文件 [英] How can I exclude a specific file from TFS source control

查看:90
本文介绍了如何从 TFS 源代码管理中排除特定文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有多个配置文件(app.DEV.config、app.TEST.config 等)和一个将正确配置文件复制到 app.config 的预构建事件.显然,特定于配置的文件在源代码管理中 --- 但目前 App.Config 也是如此,不应该如此.

We have multiple config files (app.DEV.config, app.TEST.config, etc) and a pre-build event that copies the correct config file to app.config. Obviously the configuration specific files are in source control --- but at the moment so is App.Config, and that shouldn't be.

如何将那个文件标记为从源代码管理中排除,但显然不是从项目中排除.

How can I mark that one file as excluded from source control, but obviously not from the project.

我使用的是 VS 2005 和 2005 Team Explorer.

I'm using VS 2005, and 2005 Team Explorer.

推荐答案

MS Power Tools 中有一个签入策略(Forbidden Patterns Policy),它允许您根据正则表达式筛选文件名.请参阅:Microsoft Team Foundation Server Power Tools

There is a checkin policy (Forbidden Patterns Policy) in the MS Power Tools which lets you screen filenames against a regular expression. See: Microsoft Team Foundation Server Power Tools

虽然签入策略并非完全万无一失,但它们是 TFS 必须执行的最接近于执行用户定义的规则(如您正在寻找的规则).

While checkin policies are not completely foolproof, they are the closest thing TFS has to enforcing user-defined rules like what you're looking for.

(正如其他人所说,您还可以隐藏文件或文件夹,这意味着它保留在源代码管理中并且团队中的其他人都可以看到,但在您决定取消隐藏之前它不会复制到您的 PC; 或者您可以删除该文件,这意味着它会在每个人的 PC 获得最新版本时从他们的 PC 中删除 - 但这些选项都不会首先阻止将此类文件添加到源代码管理中)

(And as the others have said, you can also cloak a file or folder, which means it stays in Source Control and is visible to everyone else on the team, but it's not copied to your PC until you decide to uncloak it; or you can delete the file, which means it gets deleted from everybody's PCs when they get latest - but neither of these options will prevent such files being added to source control in the first place)

这篇关于如何从 TFS 源代码管理中排除特定文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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