Sourcegraph DocsSourcegraph Docs
  • Code Intelligence

    • Cody
    • Code Search
  • Code Management

    • Batch Changes
    • Code Monitoring
    • Code Ownership
    • Code Insights
    • Notebooks
  • Platform

    • Sourcegraph Admin
    • Sourcegraph Cloud
    • Integrations
  • CLI & API

    • Sourcegraph & Cody CLI
    • Sourcegraph GraphQL API
    • Sourcegraph Stream API
  • Help & Support

    • SLAs & Premium Support
    • How to videos
    • Tutorials
    • Sourcegraph Accounts
    • Changelog
    • Technical changelog
    • Releases
  1. Docs
  2. admin
  3. how-to
  4. internal_github_repos

How to import internal organization GitHub repositories to Sourcegraph

This document will walk you through the steps of adding internal organization GitHub repositories to Sourcegraph without manually having to maintain an explicit list.

Prerequisites

This document assumes that you have:

  • Site-admin level permissions on your Sourcegraph instance.
  • Access to your Sourcegraph deployment.
  • Internal Github repositories in your organization.

Steps to import internal GitHub repositories

  1. Using the repositoryQuery configuration option, pass the org flag to specify the name of the organization the internal repositories belong to and;
  2. Add is : internal to the same line.

For example:

SHELL
"repositoryQuery": [ "org:$name is:internal" ],

How to check that you now have internal repositories

Confirm that you have cloned repositories in your instance by accessing your GraphQL console on $your_sourcegraph_url/api/console and running the following query;

SHELL
query{ externalServices{ nodes{ kind displayName repoCount } } }

Further resources

  • Sourcegraph GraphQL API

On this page

  1. How to import internal organization GitHub repositories to Sourcegraph

    1. Prerequisites
    1. Steps to import internal GitHub repositories
    1. Further resources

Edit this page on GitHub
Questions? Give us feedback