Skip to main content

Indexing repositories for Copilot Chat

You can improve the responses GitHub Copilot Chat is able to provide by indexing your repositories.

Who can use this feature?

Anyone with a subscription to GitHub Copilot Enterprise who has write access to a repository can index that repository.

About indexing repositories

GitHub Copilot's ability to answer natural language questions, in the context of a GitHub repository, is improved when the repository has been indexed for semantic code search.

Indexing repositories is not a requirement and will not affect responses to questions about information in knowledge bases, pull requests, issues, discussions, or commits. However, indexing can help Copilot Chat answer questions that relate directly to the code within a repository.

The indexing status of a repository is displayed on GitHub.com when you start a conversation that has a repository context. You can index the repository if it has not been indexed yet.

After you index a repository it is automatically re-indexed every time a change is pushed to the repository.

Indexing a repository

  1. On GitHub.com, browse to the repository you want to index.

  2. On any page, click the Copilot icon in the upper-right corner.

    The indexing status of the repository is displayed near top of the Copilot Chat panel.

  3. If the repository has not been indexed, an Index REPOSITORY NAME button is displayed. Click this button to start the indexing process.

    Screenshot showing the 'Index REPOSITORY NAME' button highlighted with a dark orange outline.

    Initial indexing can take up to 30 minutes for a large repository. Once a repository has been indexed for the first time, re-indexing is much quicker and the index will typically be automatically updated within 5 minutes of each push to the repository.