Adding repositories to Sourcegraph cloud
Sourcegraph cloud lets you add repositories to search with Sourcegraph without needing to self-host. You can add repositories you own or collaborate on from GitHub.com or GitLab.com.
Adding repositories you own or collaborate on from GitHub.com or GitLab.com
To add repositories you own or collaborate on from GitHub or GitLab, you must first create a code host connection:
- Go to User menu > Settings in the top navigation bar.
- Go to Code host connections in the sidebar navigation.
- Connect with GitHub and/or Gitlab using OAuth.
Once you’ve connected with a code host, you can add repositories:
- Go to User menu > Settings in the top navigation bar.
- Go to Repositories in the sidebar navigation.
- Press the Manage Repositories button.
- Choose the public repositories you own or collaborate on from your connected code hosts that you want to search with Sourcegraph.
- Press the Save button.
Adding other public repositories from GitHub.com or GitLab.com
To add public or private repositories from GitHub.com or Gitlab.com without creating a code host connection:
- Go to User menu > Settings in the top navigation bar.
- Go to Repositories in the sidebar navigation.
- Press the Manage Repositories button.
- Check Sync specific public repositories by URL under Other public repositories
- Specify public repositories on GitHub and GitLab using complete URLs to the repositories. One repository per line.
- Press the Save button.
Who can see your code on Sourcegraph cloud.
Please see who can see your code on Sourcegraph cloud.
Troubleshooting
Repositories from code hosts are missing or not showing up while adding repositories
If you’ve connected with a code host and repositories you expect to find are not shown while adding repositories in User menu > Settings > Repositories > Manage repositories, you may not have permission on the remote code host to add those repositories to Sourcegraph.
If the missing repositories belong to an organization on GitHub, review the Sourcegraph OAuth access. If necessary, grant or request access for the given organization. If you are not an owner, you will receive an email notification when an owner grants access. Then, you can follow the steps to add repositories.
If you continue to have issues, reach out to our team.