Restrict ripgrep to files known to git.
Section: Git and toolchain workflows
Search tracked files only
bash
bash
git ls-files -z | xargs -0 rg 'TODO'Explanation
This avoids build output, vendored folders, and untracked scratch files.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Git and toolchain workflows
Find candidate files with fd, then search with rg
Combine fast file discovery with fast content search.
Use ripgrep for live fuzzy-finder reloads
Power an interactive search UI in fzf.
Open ripgrep results in Vim quickfix
Feed matches into an editor workflow.
Point ripgrep at a config file
Set a path that ripgrep reads for default arguments.
Emit vimgrep-style results
Print `file:line:column:text` output for editors.