Getting Started
This page will help you learn and understand about Sourcegraph and how to use it.
What is Sourcegraph?
Sourcegraph is a Code Intelligence platform that deeply understands your code, no matter how large or where it's hosted, to power modern developer experiences.
Who should use Sourcegraph?
In addition to the companies listed on about.sourcegraph.com, companies with a few hundred developers up to those with more than 40,000 use Sourcegraph daily.
More specifically, Sourcegraph is great for all developers except:
- those on smaller teams with a small amount of code
- those who rarely search, read, or review code
Why do I need Code Search?
Facebook and Google provide their employees with an in-house Sourcegraph-like code search and intelligence tool. A published research paper from Google and a Google developer survey showed that 98% of developers surveyed consider their Sourcegraph-like internal tool to be critical. Developers use it on average for 5.3 sessions each day. (Facebook's and Google's in-house tools are unavailable to other companies; use Sourcegraph instead.)
What do I use Sourcegraph for?
Sourcegraph helps you:
- Find example code
- Explore/read code (including during a code review)
- Debug issues
- Locate a specific piece of code
- Determine the impact of changes
- And more!
Sourcegraph makes it easier for you and everyone else in your organization to perform these tasks.
What does Sourcegraph do?
Sourcegraph's main features are:
- Code navigation: jump-to-definition, find references, and other smart, IDE-like code browsing features on any branch, commit, or PR/code review
- Code search: fast, up-to-date, and scalable, with regexp support on any branch or commit without an indexing delay (and diff search)
- Notebooks: pair code and markdown to create powerful live and persistent documentation
- Cody: read and write code with the help of a context-aware AI code assistant
- Code Insights: reveal high-level information about your codebase at its current state and over time to track migrations, version usage, vulnerability remediation, ownership, and anything else you can search in Sourcegraph
- Batch Changes: make large-scale code changes across many repositories and code hosts
- Integrations with code hosts, code review tools, editors, web browsers, etc.
How do I start using Sourcegraph?
- Deploy and Configure Sourcegraph inside your organization on your internal code if nobody else has yet
- Install and configure the web browser code host integrations (recommended)
- Start searching and browsing code on Sourcegraph by visiting the URL of your organization's internal Sourcegraph instance
- Personalize Sourcegraph with themes, quick links, and badges!
You can also try Sourcegraph.com, a public Sourcegraph instance for use on open-source code only.
How is Sourcegraph licensed?
Sourcegraph Enterprise is Sourcegraph's primary offering and includes all code intelligence platform features. Sourcegraph Enterprise is the best solution for enterprises who want to use Sourcegraph with their organization's code.
Sourcegraph extensions are also OSS licensed (Apache 2), such as:
How is Sourcegraph different from the GitHub code search?
Code Search
Sourcegraph code search is fast, works across all your repositories at any commit, and has minimal indexing delay. Code search also includes advanced features, including:
- Powerful, flexible query syntax
- Commit diff search
- Commit message search
- Saved search scopes
- Search contexts to search across a set of repositories at specific revisions
- Saved search monitoring
Read the code search documentation to learn more and discover the complete feature set. Here's a video to help you get started:
Code Navigation
Sourcegraph gives your development team cross-repository IDE-like features on your code:
- Hover tooltips
- Go-to-definition
- Find references
- Symbol search
Sourcegraph gives you code navigation in:
- code files in Sourcegraph's web UI
- diffs in your code review tool, via integrations
- code files on your code host, via integrations
Please read the code navigation documentation to learn more and to set it up.
Cody
Cody is an AI code assistant that uses Sourcegraph code search, the code graph, and LLMs to provide context-aware answers about your codebase. Cody can explain code, refactor code, and write code, all within the context of your existing codebase.
Notebooks
Increase dev collaboration and self-service through live documentation covering best practices, shared code, and processes.
Read the Notebooks documentation to learn more, and check out these publicly available notebooks.
Batch Changes
Automate changes to your codebase. Reduce effort, reduce errors, and enable developers to focus on high-value work.
Read the batch changes documentation to learn more, including helpful how-to guides. Want a video tutorial? Check out this batch change tutorial
Code Insights
Sourcegraph lets you understand and analyze code trends by visualizing how the codebase changes. Measure and act on engineering goals such as migration and component deprecation.
Read the code insights documentation to learn more, including helpful how-to guides.
Integrations
Sourcegraph allows you to get code navigation and code search on code files and code review diffs in your code host and review tool or from your IDE.
IDE integration
Sourcegraph's editor integrations allow you to search and navigate across all of your repositories without ever leaving your IDE or checking them out locally. Learn more about how to set them up here.
Browser extension
Our browser extension directly adds code navigation within your code hosts (GitHub, GitLab, Bitbucket, and Phabricator) via Chrome, Safari, and Firefox browsers. Learn more about how to set up the browser extension here.