Skip to main content

Indexing repositories for Copilot Chat

GitHub Copilot Chat improves responses to questions about code by indexing your repositories.

Benefit of indexing repositories

Copilot's ability to answer natural language questions like these in a repository context is optimized when the semantic code search index for the repository is up to date. For more information, see Indexing repositories for Copilot Chat.

When you start a conversation with Copilot Chat that has a repository context, the repository is automatically indexed to improve answers to your questions about the code in GitHub and Visual Studio Code.

Copilot Chat will not use your indexed repository for model training.

About index creation and use

Indexing runs in the background and 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 to include the latest changes within 5 minutes of you starting a new conversation.

Once an index has been created for a repository, Copilot Chat uses it to answer questions asked by any Copilot user in GitHub and Visual Studio Code.

Excluding content from Copilot Chat answers

Enterprise or organization owners with a Copilot Enterprise or Copilot Business plan can define content exclusions to control the behavior of GitHub Copilot for the Copilot seats they manage. For more information, see Excluding content from GitHub Copilot.

If a semantic code search index is created for a repository that is included in a content exclusion policy, data is filtered according to the policy before being passed to Copilot Chat.