In January 2024 GitHub announced on GitHub blog the re-deployment of content exclusions for GitHub Copilot which allows repository administrators and organization owners to manage content exclusion settings for GitHub Copilot. This feature is currently in public beta and available for organization accounts with a Copilot Business subscription and is supported in Visual Studio, Visual Studio Code, JetBrains IDEs, and neovim.
But how does it work? Does it also work for non GitHub repositories? Yes, it does! Let’s have a look on how it works and how to configure it.
So basically you can either only exclude files in a specific repository, files in any Git-based repository or even a complete repository using a specific syntax. Exclusions prevent usage of the specified files to inform code completion suggestions made by GitHub Copilot. This means content of such files is not sent to the GitHub Copilot service and GitHub Copilot will be automatically disabled when editing such files in one of the supported IDEs. If you exclude a whole repository, GitHub Copilot will be automatically disabled for all the files in the corresponding repository when editing them in the IDE.
The content exclusion settings for GitHub Copilot on organization level can be managed as follows.
- Go to your GitHub organization by opening the following URL in your browser
<a href="https://github.com/organizations/https://github.com/organizations/<organization-name>/settings/profile (<organization-name>to be replaced with the name of your organization – be aware that you have to be an owner of the GitHub organization to be able to manage the settings) - Navigate to
Copilotin the menu on the left - Click on
Content exclusion
Then you see a text field that allows you to specify repositories and paths which should be excluded.

This example excludes all files in myrepo that resides under example.com/myrepo.
When accessing an excluded file or in this case any file of this repository in your IDE, GitHub Copilot is automatically disabled:

For more details regarding content exclusion and the syntax, check the official docs.
There are two important things to mention regarding content exclusions for GitHub Copilot.
- Propagation of changes to content exclusion settings can take up to 30 minutes until they take effect in IDEs where the settings are already loaded
For example for testing purposes, the propagation can be manually enforced (see here) - GitHub Copilot Chat is currently not affected by these settings

Leave a Reply