Sourcegraph Tutorials
Explore to learn more about Sourcegraph tutorials and guides.
Find Your Way Around Sourcegraph
| Topic | Content Type | Description |
|---|---|---|
| Sourcegraph 101 | Explanation | What is Sourcegraph? Who should use it? Why do I need it? What does it do? |
| High Level Product Demo | Explanation (video) | A short 3-minute video describing what Sourcegraph is and how it can be useful. |
| Navigating the Sourcegraph UI | Tutorial (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
| Topic | Content Type | Description |
|---|---|---|
| Product Tour in VSCode | Tutorial (video) | A video tutorial walkthrough of Cody in VSCode. |
| Cody Admin Training | Tutorial (video) | A video tutorial explaining Cody administrative functionality. |
| Cody Web - Overview | Tutorial (video) | Intro to the Cody web feature. |
| Cody IDE - Overview | Tutorial (video) | Intro to the Cody extension in an IDE. |
| Cody IDE - Chat | Tutorial (video) | Intro to Cody chat in an IDE. |
| Cody IDE - Autocomplete | Tutorial (video) | Intro to Cody autocomplete in an IDE. |
| Cody IDE - Commands | Tutorial (video) | Intro to Cody commands in an IDE. |
| LLM Fundamentals | Tutorial (video) | LLM basics and how they impact coding assistants. |
| Cody Context Retrieval | Tutorial (video) | Demystifying Cody context retrieval. |
| Task Categorization | Tutorial (video) | Introducing a task categorization framework to help you use coding assistants effectively. |
| Cody Use Cases in the Developer Workflow | Tutorial (video) | Thinking about how to use Cody in the typical developer workflow. |
| Generate Unit Tests | Tutorial (video) | A video tutorial of how to write unit tests with Cody. |
| Writing Faster Code with Code Search and Cody | Tutorial (video) | A video tutorial of how Sourcegraph can help you write code faster. |
Code Search
Full search query syntax.
Getting Started
| Topic | Content Type | Description |
|---|---|---|
| Three Types of Code Search | Tutorial (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 Results | Tutorial (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 Filters | Tutorial (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 Types | Tutorial (video) | Navigating the Code Search web app and the Keyword, Literal, Regex, and Structural search. |
| Search Results Page Overview | Tutorial (video) | Navigating the search results page. |
| Intro to Search Filters | Tutorial (video) | An overview of the most commonly-used search filters such as Language, Repo, and File. |
| Search Types | Tutorial (video) | Searching against Code, Repo, Path, Symbol, Commit, and Diff data. |
| Saving Searches | Tutorial (video) | Saving commonly-used searches. |
| Search Contexts | Tutorial (video) | Intro to Search Contexts and how to manage them. |
Advanced Searching
| Topic | Content Type | Description |
|---|---|---|
| Regular Expression Search Deep Dive | Tutorial | Regular 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 | Tutorial | 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. |
| 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. |
| Non-default branches, revisions, and tags | Tutorial (video) | Intro to Revision search and how to search for specific branches, revisions, and tags. |
| Commit messages | Tutorial (video) | Searching type:commit messages. |
| Diffs | Tutorial (video) | Searching type:diff. |
| Added or removed code | Tutorial (video) | Combining type:diff with select:commit.diff.(added OR removed). |
| By author | Tutorial (video) | Using the author: filter. |
| Time-boxing searches | Tutorial (video) | Using the before: and after: filters. |
| Boolean operators | Tutorial (video) | Using AND, OR, and NOT operators. |
| Functions and other symbols | Tutorial (video) | Using type:symbol filter. |
| Advanced symbol search | Tutorial (video) | Combining the select:symbol.(symbol_type) and type:symbol filters. |
| Selecting metadata | Tutorial (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 search | Tutorial (video) | Using repo:has.(...) filters. |
| Excluding stale repos | Tutorial (video) | Using repo:has.commit.after(...) filter. |
| Understand scope and impact of a code change | Tutorial (video) | A video tutorial of how to understand the scope and impact of a change you're considering to your codebase. |
Code Navigation
| Topic | Content Type | Description |
|---|---|---|
| Introduction to Code Navigation | Explanation | There are 2 types of code navigation that Sourcegraph supports: search-based and precise. |
| Code Navigation Features | Explanation | An overview of Code Navigation features, such as "find references", "go to definition", and "find implementations". |
| Code Navigation | Tutorial (video) | Finding definitions and references, and an explanation of precise versus search-based code navigation. |
Code Insights
| Topic | Content Type | Description |
|---|---|---|
| Code Insights Overview | Explanation (video) | Learn about common Code Insights use cases and see how to create an insight. |
| Quickstart Guide | Tutorial | Get started and create your first code insight in 5 minutes or less. |
| Common Use Cases | Reference | A list of common use cases for Code Insights and example data series queries you could use. |
| Code Insights | Tutorial (video) | Intro to Code Insights. |
Batch Changes
| Topic | Content Type | Description |
|---|---|---|
| Introduction to Batch Changes | Explanation | A basic introduction to the concepts, processes, and supported environments behind Batch Changes. |
| Get Started With Batch Changes | Tutorial (video) | Learn how you can quickly use Sourcegraph Batch Changes to automate small and large-scale code changes server-side. |
| Batch Changes Quickstart Guide | Tutorial | Get 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-Side | How-To-Guide | Follow this guide to learn how to run batch changes server-side. |
| Batch Changes | Tutorial (video) | Intro to managing Batch Changes and the batch spec file. |
Code Monitoring
| Topic | Content Type | Description |
|---|---|---|
| Code Monitoring | Tutorial (video) | Intro to Code Monitoring. |
The Sourcegraph API
| Topic | Content Type | Description |
|---|---|---|
| GraphQL API | Reference | The Sourcegraph GraphQL API is a rich API that exposes data related to the code available on a Sourcegraph instance. |
| GraphQL Examples | Reference | This page demonstrates a few example GraphQL queries for the Sourcegraph GraphQL API. |
| Streaming API | Reference | With 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
| Topic | Content Type | Description |
|---|---|---|
| Search Notebooks Quickstart Guide | Tutorial | Notebooks enable powerful live–and persistent–documentation, shareable with your organization or the world. |
Customizing Your Sourcegraph User Environment
| Topic | Content Type | Description |
|---|---|---|
| Using Sourcegraph with your IDE | How-To-Guide | Sourcegraph'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 Extension | How-To-Guide | The 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 CLI | How-To-Guide | src 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. |