Sourcegraph Tutorials

Explore to learn more about Sourcegaph tutorials and guides.

Find Your Way Around Sourcegraph

TopicContent TypeDescription
Sourcegraph 101ExplanationWhat is Sourcegraph? Who should use it? Why do I need it? What does it do?
High Level Product DemoExplanation (video)A short 3-minute video describing what Sourcegraph is and how it can be useful.
Navigating the Sourcegraph UITutorial (video)Take a look at how you can read code, find references, troubleshoot errors, gain insight, and make changes on a massive scale in Sourcegraph.

Get Started Searching

TopicContent TypeDescription
Three Types of Code SearchTutorial (video)Code search is a vital tool for developers. It's great for digging up answers to questions from your own codebase, but it's even better for exploring and understanding code. This video will show you the types of code search we have on Sourcegraph.
Understanding Code Search ResultsTutorial (video)In this video, you'll understand the search results page and how to scope, export, save, and link to search results.
Basic Code Search FiltersTutorial (video)In this video, you'll learn how to use Sourcegraph's code search filters and how they work. Filters are a great way to narrow down or search for specific code. This video covers language, repo, branch, file, and negative filters.
Search Query SyntaxReferenceThis page describes search pattern syntax and filters available for code search

More Advanced Searching

TopicContent TypeDescription
Search SubexpressionsTutorialSearch subexpressions combine groups of filters like repo: and operators like AND & OR. Compared to basic examples, search subexpressions allow more sophisticated queries.
Regular Expression Search Deep DiveTutorialRegular expressions, often shortened as regex, help you find code that matches a pattern (including classes of characters like letters, numbers and whitespace), and can restrict the results to anchors like the start of a line, the end of a line, or word boundary.
Structural Search Tutorial TutorialStructural search helps you search code for syntactical code patterns like function calls, arguments, if...else statements, and try...catch statements. It's useful for finding nested and recursive patterns as well as multi-line blocks of code.
Structural Search Tutorial Tutorial (video)Structural search helps you search code for syntactical code patterns like function calls, arguments, if...else statements, and try...catch statements. It's useful for finding nested and recursive patterns as well as multi-line blocks of code.

Cody

TopicContent TypeDescription
Product Tour is VSCodeTutorial (video)A video tutorial walkthrough of Cody in VSCode.
Cody Admin TrainingTutorial (video)A video tutorial explaining Cody administrative functionality.
Cody Tutorial in VS CodeTutorial (written)A single documentation page with animated .gifs, demonstrating Cody features in VS Code

Code Navigation

TopicContent TypeDescription
Introduction to Code NavigationExplanationThere are 2 types of code navigation that Sourcegraph supports: search-based and precise.
Code Navigation FeaturesExplanationAn overview of Code Navigation features, such as "find references", "go to definition", and "find implementations".

Code Insights

TopicContent TypeDescription
Code Insights OverviewExplanation (video)Learn about common Code Insights use cases and see how to create an insight.
Quickstart GuideTutorialGet started and create your first code insight in 5 minutes or less.
Common Use CasesReferenceA list of common use cases for Code Insights and example data series queries you could use.

Batch Changes

TopicContent TypeDescription
Introduction to Batch ChangesExplanationA basic introduction to the concepts, processes, and supported environments behind Batch Changes
Get Started With Batch ChangesTutorial (video)Learn how you can quickly use Sourcegraph Batch Changes to automate small and large-scale code changes server-side.
Batch Changes Quickstart GuideTutorialGet started and create your first batch change in 10 minutes or less. This guide follows the local (CLI) method of running batch changes.
Getting Started Running Batch Changes Server-SideHow-To-GuideFollow this guide to learn how to run batch changes server-side.

The Sourcegraph API

TopicContent TypeDescription
GraphQL APIReferenceThe Sourcegraph GraphQL API is a rich API that exposes data related to the code available on a Sourcegraph instance.
GraphQL ExamplesReferenceThis page demonstrates a few example GraphQL queries for the Sourcegraph GraphQL API.
Streaming APIReferenceWith the Stream API you can consume search results and related metadata as a stream of events. The Sourcegraph UI calls the Stream API for all interactive searches. Compared to our GraphQL API, it offers shorter times to first results and supports running exhaustive searches returning a large volume of results without putting pressure on the backend.

Search Notebooks

TopicContent TypeDescription
Search Notebooks Quickstart GuideTutorialNotebooks enable powerful live–and persistent–documentation, shareable with your organization or the world.

Customizing Your Sourcegraph User Environment

TopicContent TypeDescription
Using Sourcegraph with your IDEHow-To-GuideSourcegraph’s editor integrations allow you search and navigate across all of your repositories without ever leaving your IDE or checking them out locally. We have built-in integrations with VS Code and JetBrains.
Using the Sourcegraph Browser ExtensionHow-To-GuideThe open-source Sourcegraph browser extension adds code navigation to files and diffs on GitHub, GitHub Enterprise, GitLab, Phabricator, Bitbucket Server and Bitbucket Data Center.
Using the Sourcegraph CLIHow-To-Guidesrc is a command line interface to Sourcegraph that allows you to search code from your terminal, create and apply batch changes, and manage and administrate repositories, users, and more.
Saving SearchesHow-To-GuideSaved searches let you save and describe search queries so you can easily find and use them again later. You can create a saved search for anything, including diffs and commits across all branches of your repositories.
Search ContextsHow-To-GuideSearch contexts help you search the code you care about on Sourcegraph. A search context represents a set of repositories at specific revisions on a Sourcegraph instance that will be targeted by search queries by default.

Developer Use Cases

TopicContent TypeDescription
Writing Faster Code with Code Search and CodyTutorial (video)A video tutorial of how Sourcegraph can help you write code faster.
Generate Unit TestsTutorial (video)A video tutorial of how to write unit tests with Cody.
Understand scope and impact of a code changeTutorial (video)A video tutorial of how to understand the scope and impact of a change you're considering to your codebase.
Previous
Cody