Sourcegraph Tutorials

Explore to learn more about Sourcegraph 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.

Cody

TopicContent TypeDescription
Product Tour in VSCodeTutorial (video)A video tutorial walkthrough of Cody in VSCode.
Cody Admin TrainingTutorial (video)A video tutorial explaining Cody administrative functionality.
Cody Web - OverviewTutorial (video)Intro to the Cody web feature.
Cody IDE - OverviewTutorial (video)Intro to the Cody extension in an IDE.
Cody IDE - ChatTutorial (video)Intro to Cody chat in an IDE.
Cody IDE - AutocompleteTutorial (video)Intro to Cody autocomplete in an IDE.
Cody IDE - CommandsTutorial (video)Intro to Cody commands in an IDE.
LLM FundamentalsTutorial (video)LLM basics and how they impact coding assistants.
Cody Context RetrievalTutorial (video)Demystifying Cody context retrieval.
Task CategorizationTutorial (video)Introducing a task categorization framework to help you use coding assistants effectively.
Cody Use Cases in the Developer WorkflowTutorial (video)Thinking about how to use Cody in the typical developer workflow.
Generate Unit TestsTutorial (video)A video tutorial of how to write unit tests with Cody.
Writing Faster Code with Code Search and CodyTutorial (video)A video tutorial of how Sourcegraph can help you write code faster.

Full search query syntax.

Getting Started

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.
Intro to Sourcegraph Search TypesTutorial (video)Navigating the Code Search web app and the Keyword, Literal, Regex, and Structural search.
Search Results Page OverviewTutorial (video)Navigating the search results page.
Intro to Search FiltersTutorial (video)An overview of the most commonly-used search filters such as Language, Repo, and File.
Search TypesTutorial (video)Searching against Code, Repo, Path, Symbol, Commit, and Diff data.
Saving SearchesTutorial (video)Saving commonly-used searches.
Search ContextsTutorial (video)Intro to Search Contexts and how to manage them.

Advanced Searching

TopicContent TypeDescription
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 TutorialTutorialStructural 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 TutorialTutorial (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.
Non-default branches, revisions, and tagsTutorial (video)Intro to Revision search and how to search for specific branches, revisions, and tags.
Commit messagesTutorial (video)Searching type:commit messages.
DiffsTutorial (video)Searching type:diff.
Added or removed codeTutorial (video)Combining type:diff with select:commit.diff.(added OR removed).
By authorTutorial (video)Using the author: filter.
Time-boxing searchesTutorial (video)Using the before: and after: filters.
Boolean operatorsTutorial (video)Using AND, OR, and NOT operators.
Functions and other symbolsTutorial (video)Using type:symbol filter.
Advanced symbol searchTutorial (video)Combining the select:symbol.(symbol_type) and type:symbol filters.
Selecting metadataTutorial (video)Using select: filter to return data other than the type of data searched against, e.g. returning all repos than contain a certain function.
Advanced repo searchTutorial (video)Using repo:has.(...) filters.
Excluding stale reposTutorial (video)Using repo:has.commit.after(...) filter.
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.

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 NavigationTutorial (video)Finding definitions and references, and an explanation of precise versus search-based code navigation.

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.
Code InsightsTutorial (video)Intro to Code Insights.

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.
Batch ChangesTutorial (video)Intro to managing Batch Changes and the batch spec file.

Code Monitoring

TopicContent TypeDescription
Code MonitoringTutorial (video)Intro to Code Monitoring.

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.
Previous
SLAs & Premium Support