Skip to content
Discussion options

You must be logged in to vote

Without a concrete example, it's hard to know where the confusion is. Usually dir/* is enough, since it ignores not just all direct files in dir but also direct directories. So there is no descending in that case:

$ rg -l 'fn is_empty'
crates/matcher/src/lib.rs
crates/globset/src/lib.rs
crates/regex/src/literal.rs
GUIDE.md
crates/cli/src/process.rs
crates/ignore/src/types.rs
crates/ignore/src/overrides.rs
crates/ignore/src/gitignore.rs
crates/printer/src/hyperlink/mod.rs

$ rg -l 'fn is_empty' -g '!crates/*'
GUIDE.md

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by BurntSushi
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 #3160 on October 11, 2025 00:39.