tfignore wildcard directory segment

后端 未结 2 1585
礼貌的吻别
礼貌的吻别 2021-02-07 14:01

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. F

相关标签:
2条回答
  • 2021-02-07 14:39

    The documentation should more correctly read:

    The * and ? wildcards are supported in the leaf name only.

    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
    

    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.

    0 讨论(0)
  • 2021-02-07 14:51

    It seems this is now supported

    As you see I edited tfignore in the root folder of the project such that any new branch will ignore its .vs folder when being examined for source control changes

    \*\.vs
    
    0 讨论(0)
提交回复
热议问题