Code Search
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 helps 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
Search Query Syntax
Learn about the search pattern syntax and filters available for Code Search.
Search Examples
Learn about some common search use cases and examples.
Features
Learn about the core search features.
Advanced Features
Learn about advanced features like saved searches and search contexts.
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
FAQs
Does Code Search work with my repositories?
Code Search works with all your repositories. Likewise, you can also search through our public code that has a 2 million+ open source codebase.
Do I need to enable Code Navigation?
No, the default search-based code navigation works out of the box without any configuration. However, for an advanced and customized navigation experience your site admin will set up precise code navigation.
What is the max file size limit for Code Search?
By default, files larger than 1 MB are excluded from search results.
Join our community
If you have any questions about Code Search, ask in our community forum.