Sourcegraph Tutorials
Explore to learn more about Sourcegaph 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. |
Get Started Searching
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. |
Search Query Syntax | Reference | This page describes search pattern syntax and filters available for code search |
More Advanced Searching
Topic | Content Type | Description |
---|---|---|
Search Subexpressions | Tutorial | Search 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 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. |
Cody
Topic | Content Type | Description |
---|---|---|
Product Tour is VSCode | Tutorial (video) | A video tutorial walkthrough of Cody in VSCode. |
Cody Admin Training | Tutorial (video) | A video tutorial explaining Cody administrative functionality. |
Cody Tutorial in VS Code | Tutorial (written) | A single documentation page with animated .gifs, demonstrating Cody features in VS Code |
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 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. |
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. |
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. |
Saving Searches | How-To-Guide | Saved 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 Contexts | How-To-Guide | Search 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
Topic | Content Type | Description |
---|---|---|
Writing Faster Code with Code Search and Cody | Tutorial (video) | A video tutorial of how Sourcegraph can help you write code faster. |
Generate Unit Tests | Tutorial (video) | A video tutorial of how to write unit tests with Cody. |
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. |