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
You can add this line to your .gitignore file: **/foo/**/.KEYFILE This pattern works as follows: • The first “**” matches any directory path (or no directory at all) before a directory named “foo.” • Then “foo” matches any directory named foo. • The following “**/” matches any files or directories under foo. • Finally, “.KEYFILE” matches that specific file name anywhere under a foo directory. With this in your .gitignore, any file called .KEYFILE located under any directory named foo—regardless of where foo appears in the repository’s directory tree—will be ignored by Git.
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
Add the following line to your .gitignore file: **/foo/**/.KEYFILE This pattern tells Git to ignore any file named .KEYFILE that appears anywhere beneath a directory called foo, no matter where that foo directory is located in your repository.
Testing if the previous output contains the string **/foo/**/.KEYFILE
: True