Ignore Directory
In all subdirectories
From Ignore Directory In All Subdirectories from .gitignore
Go to text →
Syntax
These syntaxes will ignore directory matches across ALL subdirectories.
dir_ignored
dir_ignored/
**/dir_ignored/
Example:
In the following example ALL files will be ignored, with either of the above syntax.
.
├── dir_ignored
│ ├── f1.txt
│ └── subdir-in-ignored
│ └── f2.txt
└── subdir-in-top
└── dir_ignored
└── f3.txt
4 directories, 3 files
Clarification
Must match directory exactly
The syntax that we used here must match directory exactly.
For example if we add suffix to directory name it WILL not match:
.
├── dir_ignored
│ └── gets-ignored.txt
└── dir_ignored_2
└── i-am-not-ignored.txt
2 directories, 2 files
Only next to .gitignore
From Ignore Directory Only Next to .gitignore
Go to text →
Syntax to ONLY ignore directory that is next to .gitignore
/dir_ignored/
/dir_ignored
Example with above syntax
- Anything below ./dir_ignored wil be ignored.
- ./subdir/dir_ignored/i-am-NOT-ignored.txt will NOT be ignored.
.
├── dir_ignored
│ ├── f2-ignored.txt
│ └── subdir
│ └── f1-ignored.txt
└── subdir
└── dir_ignored
└── i-am-NOT-ignored.txt
4 directories, 3 files
Children
Backlinks