Search code examples
tfstfs-2015tfignore

Recursively ignore directory by name using .tfignore


I have the following folder structure:

foo1/
  node_modules/
foo2/
  node_modules/
  bar/
    node_modules/
.tfignore

A single .tfignore file is in the root directory.

What should I add to the .tfignore in order to ignore node_modules directories recursively no matter where they are in the directory hierarchy?


There're a lot of questions similar to mine. But all are pretty wide. I want to keep it simple. Please don't suggest anything with "Pending Changes". I only need a single line in .tfignore


Solution

  • The .tfignore file will ignore the given pattern in all subdirectories (unless otherwise specified). And it will ignore files or folders with the given name. For folders, it will apply recursively.

    As a result, a .tfignore with:

    node_modules
    

    will ignore any folder named node_modules in your filesystem hierarchy, and it will ignore them recursively.