repo-grep - Man Page

repo grep — manual page for repo grep


repo grep {pattern | -e pattern} [<project>...]



Print lines matching a pattern


-h,  --help

show this help message and exit

-j JOBS, --jobs=JOBS

number of jobs to run in parallel (default: based on number of CPU cores)

Logging options


show all output

-q,  --quiet

only show errors

Multi-manifest options


operate starting at the outermost manifest


do not operate on outer manifests


only operate on this (sub)manifest

--no-this-manifest-only,  --all-manifests

operate on this manifest and its submanifests



Search the index, instead of the work tree

-r TREEish, --revision=TREEish

Search TREEish, instead of the work tree



Pattern to search for

-i,  --ignore-case

Ignore case differences

-a,  --text

Process binary files as if they were text


Don't match the pattern in binary files

-w,  --word-regexp

Match the pattern only at word boundaries

-v,  --invert-match

Select non-matching lines

-G,  --basic-regexp

Use POSIX basic regexp for patterns (default)

-E,  --extended-regexp

Use POSIX extended regexp for patterns

-F,  --fixed-strings

Use fixed strings (not regexp) for pattern

Pattern Grouping


Limit match to lines that have all patterns

--and,  --or,  --not

Boolean operators to combine patterns

-(, -)

Boolean operator grouping



Prefix the line number to matching lines


Show CONTEXT lines around match


Show CONTEXT lines before match


Show CONTEXT lines after match

-l,  --name-only,  --files-with-matches

Show only file names containing matching lines

-L,  --files-without-match

Show only file names not containing matching lines

Run `repo help grep` to view the detailed manual.


Search for the specified patterns in all project files.

Boolean Options

The following options can appear as often as necessary to express the pattern to locate:

-e Pattern

--and, --or, --not, -(, -)

Further, the -r/--revision option may be specified multiple times in order to scan multiple trees. If the same file matches in more than one tree, only the first result is reported, prefixed by the revision name it was found under.


Look for a line that has '#define' and either 'MAX_PATH or 'PATH_MAX':

repo grep -e '#define' --and -\( -e MAX_PATH -e PATH_MAX \)

Look for a line that has 'NODE' or 'Unexpected' in files that contain a line that matches both expressions:

repo grep --all-match -e NODE -e Unexpected


July 2022 repo grep Repo Manual