This guide shows how to add a GitHub repository to your Sourcegraph instance. For the purposes of the guide we’ll be using https://github.com/moby/moby
<style> .markdown-body pre.chroma { font-size: 0.75em; } img.screenshot { display: block; margin: 1em auto; max-width: 600px; margin-bottom: 0.5em; border: 1px solid lightgrey; border-radius: 10px; } </style>-
On your Sourcegraph instance, navigate to your Site Admin by clicking on your profile icon and selecting Site admin.
-
In the Repositories section in the left bar, click on Manage repositories. If you have already configured a GitHub code host connection, click on the Edit button and skip to step 5. If you haven’t, click on Add repositories.
-
Replace
<access token>
with your GitHub access token. If you don’t have one yet see GitHub API token and access.{ "url": "https://github.com", "token": "<access token>", "orgs": [] }
-
Click on Add a single repository and replace
<owner>/<repository>
with your selected repo's name and owner (in this case"moby/moby"
). -
Make sure to click on the Add repositories button below to save your changes.