.tfignore 没有使用通配符忽略我的文件

.tfignore is not ignoring my files using wildcards


我在 TFS 中有一个带有分支的项目,我想忽略每个分支中的一些文件夹。
所以我尝试忽略所有分支文件夹,但它不起作用:

\Tools\Web\APPREPORTS\Branches\*\node_modules\
\Tools\Web\APPREPORTS\Branches\*\packages\

所以它迫使我以这种方式来指定每个分支:

\Tools\Web\ALMAREPORTS\Branches\DEV\node_modules\
\Tools\Web\ALMAREPORTS\Branches\DEV\packages\
\Tools\Web\ALMAREPORTS\Branches\STAGE\packages\
\Tools\Web\ALMAREPORTS\Branches\STAGE\node_modules\
\Tools\Web\ALMAREPORTS\Branches\PRODUCTION\packages\
\Tools\Web\ALMAREPORTS\Branches\PRODUCTION\node_modules\

还有另一种方法可以简化吗?
提前致谢。

使用两个星号:

\Tools\Web\APPREPORTS\Branches\**\node_modules\
\Tools\Web\APPREPORTS\Branches\**\packages\

不支持您的方法。 * 和 ?仅叶名称支持通配符。 此答案中的更多详细信息:tfignore wildcard directory segment

这取决于您将 .tfignore 文件放在哪个文件夹中。 您可以只使用 \node_modules 忽略此文件夹中的所有文件。

以下规则适用于 .tfignore 文件:

# begins a comment line

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)

Source: MSDN Documentation