Code Search - Sourcegraph docs

Learn how to search code across all your repositories and code hosts.

Code Search allows you to find, fix, and navigate code with any code host or language across multiple repositories with real-time updates. It deeply understands your code, prioritizing the most relevant results for an enhanced search experience.

Sourcegraph's Code Search empowers you to:

  • Utilize regular expressions, boolean operations, and keyboard shortcuts to help you unleash the full potential of your searches
  • With the symbol, commit, and diff search capabilities, it identifies code vulnerabilities in milliseconds and quickly helps you resolve issues and incidents
  • Offers innovative code view with seamless code navigation for a comprehensive coding experience

Getting started

Features

Code Search main features include:

  • Use regular expressions and keyword queries to perform full-text searches
  • Search any branch and commit, with no indexing required
  • Search commit diffs and commit messages to see how code has changed
  • Narrow your search by repository and file pattern
  • Use search contexts to search across a set of repositories at specific revisions
  • Curate saved searches for yourself or your org
  • Use code monitoring to set up notifications for code changes that match a query
  • View language statistics for search results

Architecture

Learn about how Code Search fits into Sourcegraph in the architecture overview.