Skip to content

do ignore files ignore things based on file path or file contents? #2258

Answered by BurntSushi
jzhao2007 asked this question in Q&A
Discussion options

You must be logged in to vote

Ignore files only ignore things based on the file path. From your example, it seems like you've somehow come under the impression that they work by looking at the file contents. They don't, just like .gitignore files don't. Only file paths. So if you want to ignore test2.txt, you need to put test2.txt in your ignore file.

I've converted this to a Discussion Question because this isn't a bug. And I made the title a bit more descriptive.

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by BurntSushi
Comment options

You must be logged in to vote
2 replies
@jzhao2007
Comment options

@BurntSushi
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@BurntSushi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2257 on July 14, 2022 13:33.