Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 886
scor4er Avatar asked Apr 17 '18 15:04

scor4er


1 Answers

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.

like image 61
Edward Thomson Avatar answered Nov 20 '22 15:11

Edward Thomson