Skip to main content

About content exclusions for GitHub Copilot

Learn how content exclusions for GitHub Copilot work.

Wer kann dieses Feature verwenden?

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.

Organisationen mit einem Abonnement für GitHub Copilot Business oder GitHub Copilot Enterprise.

  • Inhalte von GitHub Copilot auszuschließen liegt derzeit als öffentliche Betaversion vor und kann noch geändert werden.
  • Dieses Feature wird für GitHub Copilot Code-Vervollständigung in Visual Studio, Visual Studio Code, JetBrains IDEs und Neovim unterstützt. Sie wird auch für GitHub Copilot Chat in VS Code unterstützt. Ausführliche Informationen zu unterstützten JetBrains-IDEs finden Sie unter „Verwendung von GitHub Copilot-Codevorschlägen in Ihrem Editor“.

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.

Nachdem dem Hinzufügen oder Ändern von Inhaltsausschlüssen kann es bis zu 30 Minuten dauern, bis sie in IDEs wirksam wird, in denen die Einstellungen bereits geladen wurden. Sie können Änderungen auf Ihre eigene IDE anwenden, indem Sie das erneute Laden der Einstellungen für Inhaltsausschlüsse erzwingen. 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

  • Mit Ausnahme von Visual Studio Code wird der Inhaltsausschluss für GitHub Copilot Chat derzeit nicht unterstützt.
  • Der Inhaltsausschluss wird in GitHub Copilot Chat in Visual Studio Code und Copilot Chat in Visual Studio nicht angewendet, wenn Sie in Ihrer Frage den @github Copilot Chat-Teilnehmer verwenden.
  • Es ist möglich, dass Copilot semantische Informationen aus einer ausgeschlossenen Datei verwenden kann, wenn die Informationen von der IDE in einer nicht ausgeschlossenen Datei bereitgestellt werden. Beispiele für solche Inhalte sind Typinformationen und Hover-Over-Definitionen für im Code verwendete Symbole.

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?

GitHub Copilot-Einstellungen für Inhaltsausschlüsse gelten nicht für alle, die Copilot nutzen.

Eine Einstellung für Inhaltsausschlüsse gilt nur für Personen, denen ein Arbeitsplatz als Teil einer GitHub Copilot Business- oder GitHub Copilot Enterprise-Subscription gewährt wurde und die Mitglieder derselben Organisation sind, wo der Inhaltsausschluss konfiguriert ist. Andere Benutzer, die auf die angegebenen Dateien zugreifen können, sind vom Inhaltsausschluss nicht betroffen und sehen weiterhin Codeabschlussvorschläge.

All exclusions, whether they are defined in repository settings or in organization settings, apply to all members of the organization who have been granted a Copilot seat as part of a Copilot Business subscription.

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."