Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tfignore wildcard directory segment

Tags:

tfs

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

Documentation

# 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)

Extract from the documentation.

like image 310
Malachi Avatar asked Feb 04 '14 17:02

Malachi


1 Answers

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.

like image 129
Michael Sorens Avatar answered Oct 18 '22 03:10

Michael Sorens