rgb · ripgrep everything, plus every git branch
Light modeDark mode


ripgrep every branch

rgb searches what rg searches, then searches every local branch of every Git repository it finds.

$ rgb 'TODO'
git:feature/auth:src/auth.py:2:    # TODO verify token
git:main:src/app.py:2:    # TODO drop this
git:release/1.2:src/app.py:2:    # TODO drop this
scratch.txt:1:TODO not committed yet

Point it at one repository, a workspace holding hundreds of them, or a tree with no repositories at all. Every flag rgb does not recognize goes to the real rg, so type filters, globs, context, PCRE2, and ripgrep’s regex dialect keep working.

rgb -i SKIP_DEPLOY ~/work
rgb --all -t go -A2 --pcre2 'func \w+\(ctx'
rgb --refs 'refs/heads/feature/*' api_key

A modified file has two searchable versions. The unlabelled result is your working copy; the labelled result is the committed branch.

config.yml:12:SKIP_DEPLOY = true
git:main:config.yml:12:SKIP_DEPLOY = false

Install

Homebrew, built from source against main:

brew install --HEAD atamanroman/taps/rgb

Or build it directly:

git clone https://github.com/atamanroman/rgb.git
cd rgb
go build -o ~/.local/bin/rgb .

With Nix, git and rg are wrapped into the result:

nix run github:atamanroman/rgb

Why not git grep?

git grep already searches multiple refs and is the right tool when its regex engine is enough. rgb is for searches that need ripgrep itself: its speed, filters, glob behavior, type definitions, output options, or regex dialect.

It searches the working tree once and materializes only file versions absent from disk. Materialized blobs are deduplicated by (path, blob) and hardlinked into place, keeping large multi-repository searches close to the cost of ordinary ripgrep.

Read the full documentation and source.