tfignore 通配符目录段 [英] tfignore wildcard directory segment

查看:29
本文介绍了tfignore 通配符目录段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 .tfignore 向目录添加通配符?我认为这只是在目录段中添加星号通配符的情况.例如:

Is it possible using .tfignore to add a wildcard to directories? I assumed it would have been a case of just adding an asterisk wildcard to the directory segment. For example:

\path\*\local.properties

然而,这不起作用,我不确定如何在不明确声明我需要排除的每个引用的情况下实现这种行为..

However this does not work and I am unsure how I would achieve such behaviour without explicitly declaring every reference that I need excluding. .

# 开始注释行

* 和 ?支持通配符.

The * and ? wildcards are supported.

除非以 \ 字符为前缀,否则文件规范是递归的.

A filespec is recursive unless prefixed by the \ character.

!否定文件规范(匹配模式的文件不会被忽略)

! negates a filespec (files that match the pattern are not ignored)

摘自文档.

推荐答案

文档应该更正确地阅读:

The documentation should more correctly read:

* 和 ?仅在叶名称中支持通配符.

也就是说,您可以使用类似的方法分别在一个公共父目录中选择多个文件或多个子目录:

That is, you can use something like these to select multiple files or multiple subdirectories, respectively, in a common parent:

/path/to/my/file/foo*.txt
/path/to/my/directories/temp*

在您的情况下可能有用的方法——忽略多个目录中的相同文件——就是这样:

What may work in your case--to ignore the same file in multiple directories--is just this:

foo*.txt

也就是说,指定一个无路径名称或全局模式以忽略整个树中的匹配文件.不幸的是,您只有这两种选择,本地或全球;你不能使用这样的相对路径——它不会匹配任何文件!

That is, specify a path-less name or glob pattern to ignore matching files throughout your tree. Unfortunately you have only those two options, local or global; you cannot use a relative path like this--it will not match any files!

my/file/foo*.txt

全局选项是一个实用的选项,因为 .tfignore 只影响 未版本化 文件.将文件添加到源代码管理后,将正确识别对该文件的更改.此外,如果您需要将忽略名称的实例添加到源代码管理,您可以随时进入 TFS 源代码管理资源管理器并手动添加.

The global option is a practical one because .tfignore only affects unversioned files. Once you add a file to source control, changes to that file will be properly recognized. Furthermore, if you need to add an instance of an ignored name to source control, you can always go into TFS source control explorer and manually add it.

这篇关于tfignore 通配符目录段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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