Why ripgrep Misses Your Files: Hidden Files, Ignore Rules and Exact Matches
Fix missing ripgrep results with tested commands for hidden files, ignored folders and literal text, plus illustrated results from a five-file repository.
You know a setting exists. You saw it in a configuration file ten minutes ago. Then you search the project with rg, and the result seems to insist it is not there.
Before rewriting the pattern, check which files the command was allowed to read. A hidden file and an ignored folder are two different reasons for a search to miss something. Turning off one filter does not necessarily turn off the other.
We reproduced that distinction with ripgrep 15.1.0 on Windows using a small Git repository. The same search found one, three or five matching files depending on the options. Here is how to diagnose the difference without turning every search into a crawl through dependencies.

What you need
Run rg --version first. The executable is called rg, although the project is named ripgrep. If it is not installed, use the project's official installation instructions or release downloads. Avoid downloading an executable from an unrelated tutorial site.
The project is open source, with MIT or Unlicense licensing options. There is no paid tier needed for these commands. Source repository and MIT license.
The commands below use PowerShell-compatible quoting. They read files; none rewrites your application. Run them from the directory you want to investigate. For a predictable baseline, the examples include --no-config, which prevents a personal ripgrep configuration from silently adding options.
Meet the tiny repository
Our test contained these files:
demo/
.gitignore
.env.example
.settings/config.txt
src/app.txt
dist/bundle.txt
node_modules/demo/index.txt
The .gitignore contained just two rules:
dist/
node_modules/
Five text files contained a line beginning with feature_flag. Each used a different value so the results revealed which file had been read. The sample environment file contained no real credentials.
This was an initialized Git repository. That detail matters when reproducing .gitignore behaviour. If you copy the folder layout into an arbitrary directory without initializing Git, do not assume your results will be identical.
The baseline search was:
rg --no-config -n 'feature_flag' .
It returned one match:
./src/app.txt:1:feature_flag=on
The filename, line number and value tell us the pattern works. The missing files need a scope check, not a more elaborate regular expression. Paths are normalized to forward slashes here for readability; Windows output may use backslashes, and result order can vary.
Hidden files: add the missing scope
The sample .env.example and .settings directory begin with a dot. To include them while retaining ignore rules, we ran:
rg --no-config -n --hidden -g '!.git/**' 'feature_flag' .
That produced three matching files: src/app.txt, .env.example and .settings/config.txt.
The exclusion -g '!.git/**' keeps the repository's internal metadata out of this broader search. Quote the pattern so the shell passes it as one argument.
Notice what did not appear: dist/bundle.txt and the dependency file. Adding hidden files did not cancel the ignore rules. That is useful when you want configuration files without also searching every generated bundle.
The project's filtering guide documents these separate controls. The same distinction comes up in community questions about dotfiles and ignore rules.
Ignored folders: change the other filter
To inspect generated or dependency files, we ran:
rg --no-config -n --no-ignore 'feature_flag' .
This also found three files, but they were a different three: src/app.txt, dist/bundle.txt and node_modules/demo/index.txt. Neither dotfile result appeared.
The identical count is why counting matches alone can be misleading. Always inspect the paths. A command can produce more results without including the file you actually needed.
When both categories matter, combine the controls:
rg --no-config -n --hidden --no-ignore -g '!.git/**' 'feature_flag' .
All five test files appeared. This is a useful diagnostic search in a small folder. In a large project, point it at the relevant subdirectory rather than immediately running it across everything.
Search broadly, then remove the noise
Suppose you need the generated bundle but do not care about dependencies. Keep the expanded scope and add one exclusion:
rg --no-config -n --hidden --no-ignore -g '!.git/**' -g '!node_modules/**' 'feature_flag' .
Our result dropped from five files to four. The dependency match disappeared; the hidden configuration and compiled bundle remained.
This is easier to explain to a colleague than a permanently unrestricted search alias. The command records the scope you intended, including the folder you deliberately left out.
For nested monorepos, inspect whether your exclusion covers the dependency directories at the depths you use. The example above is tested against the root-level layout shown here, not every possible project structure.

Already know the file? Name it
If you are investigating one known file, a recursive search can be unnecessary. We tested:
rg --no-config -n 'feature_flag' .env.example
The explicit path returned:
1:feature_flag=preview
Naming the file directly found the hidden file without expanding the whole directory search. That makes it a good first check when you have the path from an error message or editor tab.
Be careful when copying output from real environment files into support tickets. A successful search may reveal more information than the example here, which deliberately uses a harmless preview value.
Your literal text might be a regex
A different failure looks like too many matches. Our src/app.txt also contained these two lines:
api.example.com
apiXexampleYcom
This search matched both:
rg --no-config -n 'api.example.com' src/app.txt
Adding -F reduced the output to the exact string:
rg --no-config -n -F 'api.example.com' src/app.txt
2:api.example.com
For domains, configuration values and copied error fragments, literal matching is often the clearest starting point. You can choose a regular expression later if you actually need one. This avoids spending time debugging metacharacters when your original question was simply, "Where is this text?"
For a pattern beginning with a dash, identify it explicitly with -e. Our fourth line was --cache, and this returned it correctly:
rg --no-config -n -F -e '--cache' src/app.txt
Check the file list before the contents
Sometimes it is faster to ask which paths are visible to a search:
rg --no-config --files --hidden -g '!.git/**'
In the fixture, the list contained .env.example, .gitignore, .settings/config.txt and src/app.txt. It did not contain the ignored output or dependency files.
That list separates a file-discovery problem from a text-matching problem. If the expected path is missing, investigate the scope first. If it is present, inspect the exact spelling, case and pattern.
The official FAQ is useful for cases beyond this example. Your installed rg --help also describes the options for that exact executable.
Do not mistake no matches for a broken command
In our tests, a successful matching search exited with code 0. A valid search for a nonexistent string exited with 1. An invalid regular expression exited with 2.
That matters in scripts. Treating every nonzero status as the same failure can turn an ordinary "not found" result into a misleading error report.
If results remain surprising, keep the directory small and inspect the installed help for --debug. Read the reason a file was skipped before adding more flags. A short diagnostic with a known file is usually easier to understand than a huge result set.
The command to keep close
For a missing setting, work through three questions: is the file hidden, is it ignored, and is the pattern meant to be literal? Answer them separately. Then choose the narrowest scope that finds the evidence you need.
That is what the five-file test demonstrated. The search engine did not lose the setting. Different commands were looking at different files.
Test notes: verified on November 27, 2026 with ripgrep 15.1.0 on Windows. Ten search cases and two exit-status cases were executed against synthetic files. Results show filtering behaviour, not a performance benchmark or a security audit.