Skip to main content

About content exclusions for GitHub Copilot

Learn how content exclusions for GitHub Copilot work.

Who can use this feature?

Repository administrators and organization owners can manage content exclusion settings.

People with the "Maintain" role for a repository can view, but not edit, content exclusion settings for that repository.

Organizations with a subscription to GitHub Copilot Business or GitHub Copilot Enterprise.

Note

Excluding content from GitHub Copilot is currently in public beta and is subject to change.

You can configure GitHub Copilot to ignore certain files by excluding specific paths to content in the settings for your repository or organization.

When you specify content exclusions, there are up to three effects depending on the level of support for your IDE:

  • Code completion will not be available in the affected files.
  • The content in affected files will not inform code completion suggestions in other files.
  • The content in affected files will not inform GitHub Copilot Chat's responses.

After you add or change content exclusions, it can take up to 30 minutes to take effect in IDEs where the settings are already loaded. You can apply changes to your own IDE, forcing it to reload the content exclusion settings. See "Testing changes to content exclusions in your IDE."

Availability of content exclusions

ToolCode completion supportCopilot Chat support
Visual Studio
Visual Studio Code
JetBrains IDEs
Vim/NeovimNot applicable
Azure Data StudioNot applicable
GitHub.comNot applicable

Limitations of content exclusions

  • In Copilot Chat in Visual Studio Code, content exclusions are not applied when you use the @github chat participant in your question.
  • It's possible that Copilot may use semantic information from an excluded file if the information is provided by the IDE in a non-excluded file. Examples of such content include type information and hover-over definitions for symbols used in code.

What can you exclude?

When you specify content exclusion in the settings for a repository, you can only exclude files in that repository.

When you specify content exclusion in the settings for an organization, you can exclude files in any Git-based repository hosted on GitHub.com, or anywhere that can be accessed using any of the following syntaxes:

http[s]://host.xz[:port]/path/to/repo.git/

git://host.xz[:port]/path/to/repo.git/

[user@]host.xz:path/to/repo.git/

ssh://[user@]host.xz[:port]/path/to/repo.git/

Who is affected by a content exclusion setting?

A content exclusion setting only applies to people who meet each of the following criteria:

  • They have been granted a seat as part of a GitHub Copilot Business or GitHub Copilot Enterprise subscription
  • They are members of the same enterprise in which the content exclusion is configured

Anyone else who can access the specified files will still see code completion suggestions and GitHub Copilot Chat responses referencing the specified files.

You can't specify content exclusions in the settings for an enterprise. However, all content exclusions defined in organization or repository settings apply to all members of the enterprise who have been granted a Copilot seat as part of a Copilot Business or Copilot Enterprise subscription.

This means, for example, that if you are an admin of an organization that belongs to Enterprise X, you can set up an exclusion for files in any Git-based repositories, hosted on GitHub or elsewhere, and the exclusion will apply to anyone who gets their Copilot Business or Copilot Enterprise license from any organization in Enterprise X.

Tip

To more easily track content exclusions, create exclusions in the settings of the repository containing the affected files, or in the settings of the organization that owns the repository.

Data sent to GitHub

After you configure content exclusion, the client (for example, the Copilot extension for VS Code) sends the current repository URL to the GitHub server so that the server can return the correct policy to the client. These URLs are not logged anywhere.

Next steps

To set up content exclusions in your repository or organization, see "Configuring content exclusions for GitHub Copilot."