Sourcegraph

Shortcuts

Show search query filter list (inside search field)

CTRL + SPACE

Values

<string-literal>
<regexp-pattern>

Declarations

Match value occurrence anywhere

<filter>:<value>

Match results that begin or end with value

<filter>:^<value>
<filter>:<value>$

Find exact matches for value

<filter>:^<value>$

Exclude results that match filter and value

Filters

Repo (exact match)

Directory / File (with regex variations)

Include or exclude results containing content string

Language

Types

Type (diff, commit, repo, file, path, symbol)

Author (pair with type:diff or type:commit)

Selection

Select (repo, file, content, symbol, commit) to define result type

Example: Return list of repos that have contents which match search query

Ranges

Time box results using range phrases (eg. "1 year ago", "1 week ago", "1 day ago")

Stacking

Multiple filters can be combined or regex can be used for advanced matching

Structural search supports multi-line and complex matchers (active via search options)

Supports using ... "structural hole" syntax within queries

Examples

Useful Sample Queries

Show all diffs within repo during the last year for user

Last updated