gitignore any file called .KEYFILE anywhere under a directory foo, which itself is anywhere
gitignore any file called .KEYFILE anywhere under a directory foo, which itself is anywhere
To create a gitignore rule that ignores any file called `.KEYFILE` under any directory named `foo`, where the `foo` directory itself can be located anywhere in the repository, you would use this pattern:
1 | **/foo/**/.KEYFILE |
Testing if the previous output contains the string **/foo/**/.KEYFILE
: True
gitignore any file called .KEYFILE anywhere under a directory foo, which itself is anywhere
gitignore any file called .KEYFILE anywhere under a directory foo, which itself is anywhere
# .gitignore Pattern for .KEYFILE in foo Directories To ignore any file named `.KEYFILE` that appears anywhere under any directory named `foo` (regardless of where the `foo` directory itself is located in your repository), add this line to your `.gitignore` file:
1 | **/foo/**/.KEYFILE |
Testing if the previous output contains the string **/foo/**/.KEYFILE
: True