Skip to content

How to make rg _always_ look at all files under Git control #2436

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

You must be logged in to vote

ripgrep generally has three different types of automatic filtering, as documented in the guide: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#automatic-filtering

The first is filtering based on .gitignore, .ignore and .rgignore. The second is hidden files/directories. The third is binary files.

Generally, they are not connected with one another. So when you pass --hidden to ripgrep to squash the second type of automatic filtering, it does so for all hidden files.

With that said, you can make ripgrep search .npmrc and not .other by explicitly whitelisting it. For example, echo '!.npmrc' > .ignore will tell ripgrep to search that file even though it's hidden.

For example:

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@nkiesel
Comment options

@BurntSushi
Comment options

@nkiesel
Comment options

@BurntSushi
Comment options

@nkiesel
Comment options

Answer selected by BurntSushi
Comment options

You must be logged in to vote
0 replies
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