1
0
mirror of synced 2025-12-25 02:17:36 -05:00

Add content for content exclusion in IDE Chat, make scannability changes (#51057)

Co-authored-by: hubwriter <hubwriter@github.com>
This commit is contained in:
Sam Browning
2024-06-24 09:54:54 -04:00
committed by GitHub
parent 9c797578be
commit 4bd2669522
39 changed files with 458 additions and 345 deletions

View File

@@ -1,306 +0,0 @@
---
title: Configuring content exclusions for GitHub Copilot
shortTitle: Excluding content
intro: 'You can prevent specified files from being used to inform code completion suggestions made by {% data variables.product.prodname_copilot %}. {% data variables.product.prodname_copilot %} will not be available in excluded files.'
product: 'This feature is available for organization and enterprise accounts with a {% data variables.product.prodname_copilot_business_short %} subscription, and for enterprise accounts with a {% data variables.product.prodname_copilot_enterprise_short %} subscription.'
permissions: 'Repository administrators and organization owners can manage the content exclusion settings for {% data variables.product.prodname_copilot %}. <br><br> People with the "Maintain" role for a repository can view the content exclusion settings for that repository, but can''t change these settings. For more information, see "[AUTOTITLE](/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization)."'
redirect_from:
- /copilot/managing-copilot-business/configuring-content-exclusions-for-github-copilot
- /copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot
layout: inline
topics:
- Copilot
versions:
feature: copilot
---
{% note %}
**Note:**
{% data reusables.copilot.content-exclusion-note %}
{% endnote %}
## About configuring content exclusions
You may want to prevent certain files from being available to {% data variables.product.prodname_copilot %}. You can configure {% data variables.product.prodname_copilot %} so that it ignores these files. You do this by specifying paths to excluded content in the settings for your repository or organization.
When you specify content exclusions it has two effects:
* The content of the affected files will not be used by {% data variables.product.prodname_copilot %} to inform the code completion suggestions it makes in other files.
* {% data variables.product.prodname_copilot %} code completion will not be available in the affected files.
{% data reusables.copilot.content-exclusions-delay %} For more information, see "[Propagating content exclusion changes to your IDE](#propagating-content-exclusion-changes-to-your-ide)."
### Limitations
{% data reusables.copilot.content-exclusion-limitations %}
### 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 {% data variables.product.prodname_dotcom_the_website %} or anywhere that can be accessed using any of the following syntaxes:
```text
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/
```
{% note %}
**Note:** It's important to be aware that content can be excluded by the settings of any {% data variables.product.prodname_dotcom %} organization with a {% data variables.product.prodname_copilot_business_short %}{% ifversion ghec %} or {% data variables.product.prodname_copilot_enterprise_short %}{% endif %} subscription. Excluded files may be in a repository that is not owned by the organization in which the exclusion was defined. The excluded files may also be located in a Git-based repository that is not hosted on {% data variables.product.prodname_dotcom %}.
{% endnote %}
### Who is affected by a content exclusion setting?
{% data reusables.copilot.content-exclusions-scope %}
{% ifversion fpt %}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 {% data variables.product.prodname_copilot_short %} seat as part of a {% data variables.product.prodname_copilot_business_short %} subscription.{% endif %}
{% ifversion ghec %}
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 {% data variables.product.prodname_copilot_short %} seat as part of a {% data variables.product.prodname_copilot_business_short %} or {% data variables.product.prodname_copilot_enterprise_short %} 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 {% data variables.product.prodname_dotcom %} or elsewhere, and the exclusion will apply to anyone who gets their {% data variables.product.prodname_copilot_business_short %} or {% data variables.product.prodname_copilot_enterprise_short %} license from any organization in Enterprise X.
However, it's recommended that, where an exclusion is being defined for a {% data variables.product.prodname_dotcom %} repository, you should define this either in the settings of that repository or in the settings for the organization that owns the repository. This makes it easier to identify the exclusions that are in place for a repository than if you define the exclusions in the settings of another organization in the enterprise.
{% endif %}
### Data sent to {% data variables.product.prodname_dotcom %}
After you configure content exclusion, the client (for example, the {% data variables.product.prodname_copilot_short %} extension for {% data variables.product.prodname_vscode_shortname %}) sends the current repository URL to the {% data variables.product.prodname_dotcom %} server so that the server can return the correct policy to the client. URLs sent to the server in this way are not logged anywhere.
## Configuring content exclusions for your repository
You can use your repository settings to specify content in your repository that {% data variables.product.prodname_copilot %} should ignore.
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
1. In the "Code & automation" section of the side bar, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}**.
If your repository inherits any exclusions from {%ifversion fpt %}its parent organization{% else %} organizations in the same enterprise{% endif %}, you'll see {%ifversion ghec %}one or more{% else %} a{% endif %} gray box{%ifversion ghec %}es{% endif %} at the top of the page containing details of these exclusions. You cannot edit these settings.
{%ifversion ghec %}
{% note %}
**Note**: Exclusions that affect your repository can be defined in the settings of any organization in your {% data variables.product.prodname_dotcom %} enterprise, in addition to those defined in your repository settings.
{% endnote %}
{% endif %}
1. In the box under "Paths to exclude in this repository," enter the paths to files from which {% data variables.product.prodname_copilot_short %} should be excluded.
![Screenshot of the "Paths to exclude" text box in the repository settings for {% data variables.product.prodname_copilot_short %}.](/assets/images/help/copilot/paths-to-ignore.png)
Use the format: `- "/PATH/TO/DIRECTORY/OR/FILE"`, with each path on a separate line. You can add comments by starting a line with `#`.
You can use fnmatch pattern matching notation to specify file paths. For more information, see "[File](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch)" in the ruby-doc.org documentation.
{% note %}
**Note**: Patterns are case insensitive.
{% endnote %}
### Example of paths specified in the repository settings
```yaml annotate
# Ignore the `/src/some-dir/kernel.rs` file in this repository.
- "/src/some-dir/kernel.rs"
# Ignore files called `secrets.json` anywhere in this repository.
- "secrets.json"
# Ignore all files whose names begin `secret` anywhere in this repository.
- "secret*"
# Ignore files whose names end `.cfg` anywhere in this repository.
- "*.cfg"
# Ignore all files in or below the `/scripts` directory of this repository.
- "/scripts/**"
```
## Configuring content exclusions for your organization
You can use your organization settings to specify content, in any repository, that {% data variables.product.prodname_copilot %} should ignore.
{% data reusables.profile.access_org %}
{% data reusables.profile.org_settings %}
1. In the left sidebar, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}** then click **Content exclusion**.
1. In the box under "Repositories and paths to exclude," enter details of where {% data variables.product.prodname_copilot_short %} should be excluded.
For each repository in which you want files to be excluded from {% data variables.product.prodname_copilot_short %}, enter a reference to the repository on one line, followed by paths to locations within the repository, with each path on a separate line. Use the following format:
```yaml
REPOSITORY-REFERENCE:
- "/PATH/TO/DIRECTORY/OR/FILE"
- "/PATH/TO/DIRECTORY/OR/FILE"
- ...
```
Repositories can be referenced using various protocols. You can use any of the following syntaxes for `REPOSITORY-REFERENCE` and {% data variables.product.prodname_copilot_short %} will match them regardless of how the repository was cloned locally:
```text
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/
```
{% note %}
**Notes**:
* The `user@` and `:port` parts of the `REPOSITORY-REFERENCE` are ignored in the calculation of which paths to ignore for a repository.
* Each repository reference can contain a single `*` wildcard. For example, `https://github.com/octo-org/*` matches all repositories in the `octo-org` organization.
* There is additional support for Azure DevOps URLs. For more information, see "[Azure DevOps `REPOSITORY-REFERENCE` support](#azure-devops-repository-reference-support)."
{% endnote %}
You can use fnmatch pattern matching notation to specify file paths. For more information, see "[File](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch)" in the ruby-doc.org documentation.
{% note %}
**Note**: Patterns are case insensitive.
{% endnote %}
### Example of repositories and paths in organization settings
```yaml annotate
# Ignore all `.env` files at any path, in any repository.
# This setting applies to all repositories, not just to those on GitHub.com.
# This could also have been written on a single line as:
#
# "*": ["**/.env"]
"*":
- "**/.env"
# In the `octo-repo` repository in this organization:
octo-repo:
# Ignore the `/src/some-dir/kernel.rs` file.
- "/src/some-dir/kernel.rs"
# In the `primer/react` repository on {% data variables.product.prodname_dotcom %}:
https://github.com/primer/react.git:
# Ignore files called `secrets.json` anywhere in this repository.
- "secrets.json"
# Ignore files called `temp.rb` in or below the `/src` directory.
- "/src/**/temp.rb"
# In the `copilot` repository of any {% data variables.product.prodname_dotcom %} organization:
git@github.com:*/copilot:
# Ignore any files in or below the `/__tests__` directory.
- "/__tests__/**"
# Ignore any files in the `/scripts` directory.
- "/scripts/*"
# In the `gitlab-org/gitlab-runner` repository on GitLab:
git@gitlab.com:gitlab-org/gitlab-runner.git:
# Ignore the `/main_test.go` file.
- "/main_test.go"
# Ignore any files with names beginning `server` or `session`, anywhere in this repository.
- "{server,session}*"
# Ignore any files with names ending `.md` or `.mk`, anywhere in this repository.
- "*.m[dk]"
# Ignore files directly within directories such as `packages` or `packaged`, anywhere in this repository.
- "**/package?/*"
# Ignore files in or below any `security` directories, anywhere in this repository.
- "**/security/**"
```
## Reviewing changes to the content exclusion settings
If you are an organization owner, you can check any changes that have been made to content exclusions.
1. Open the "Content exclusion" page in the settings for your organization ([described here](#configuring-content-exclusions-for-your-organization)), or the settings for a repository ([described here](#configuring-content-exclusions-for-your-repository)).
1. Scroll to the bottom of the page.
You will see the name of the person who last changed the settings, and information about when they made this change.
1. Click the time of the last change.
![Screenshot of the last edited information. The time of change link is highlighted with a dark orange outline.](/assets/images/help/copilot/content-exclusions-last-edited-by.png)
{% note %}
**Note**: The time of the last change is only a link if you are an organization owner.
{% endnote %}
The "Audit log" page for the organization is displayed, showing the most recently logged occurrences of the `copilot.content_exclusion_changed` action.
If you clicked through from a repository settings page, the audit log is filtered to show only changes to content exclusions for that repository.
1. Click the ellipsis (...) at the end of each entry to see more details.
If the "excluded_paths" entry is truncated, hover over the truncated value to show the full entry. This displays the content of the exclusion settings after the change was saved.
![Screenshot of audit log details for the 'copilot.content_exclusion_changed' action. The ellipsis button is highlighted.](/assets/images/help/copilot/copilot-audit-log.png)
## Checking the effect of a settings change
When you change {% data variables.product.prodname_copilot_short %}'s content exclusions you can check that the setting blocks {% data variables.product.prodname_copilot_short %} from suggesting code in the specified files.
To confirm that {% data variables.product.prodname_copilot_short %} is disabled for a file, open the file in the editor and start typing a line of code, such as a comment. Normally, you would see a code completion suggestion from {% data variables.product.prodname_copilot_short %} as you type. If {% data variables.product.prodname_copilot_short %} is disabled by a content exclusion, code completion suggestions will not be offered, and the file's contents will not be used to generate suggestions in other files.
### Checking settings changes in your IDE
If you are working in {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode_shortname %}, or a supported JetBrains IDE, the {% data variables.product.prodname_copilot_short %} icon indicates when {% data variables.product.prodname_copilot_short %} has been disabled by a content exclusion.
1. Open a file that you expect to be affected by your content exclusions.
If a {% data variables.product.prodname_copilot_short %} content exclusion applies to this file, the {% data variables.product.prodname_copilot_short %} icon in the status bar has a diagonal line through it.
1. Hover over this icon. A popup message tells you whether an organization or the parent repository disabled {% data variables.product.prodname_copilot_short %} for this file.
![Screenshot of the {% data variables.product.prodname_copilot_short %} disabled popup in the {% data variables.product.prodname_vscode_shortname %} toolbar.](/assets/images/help/copilot/copilot-disabled-for-repo.png)
{% note %}
**Note**: In {% data variables.product.prodname_vs %} and {% data variables.product.prodname_vscode_shortname %} you can display the log for the {% data variables.product.prodname_copilot_short %} extension to see details of content exclusions without having to hover over the {% data variables.product.prodname_copilot_short %} icon. For more information, see "[AUTOTITLE](/copilot/troubleshooting-github-copilot/viewing-logs-for-github-copilot-in-your-environment?tool=vscode)."
{% endnote %}
### Propagating content exclusion changes to your IDE
If you are working in Neovim, content exclusions are fetched from {% data variables.product.prodname_dotcom %} each time you open a file. However, if you are working in {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode_shortname %}, or a supported JetBrains IDE, you may have to wait up to 30 minutes to see the effect of a settings change. Alternatively, you can manually reload the content exclusion settings into your IDE.
To reload content exclusions into {% data variables.product.prodname_vs %}, close and reopen the application.
To reload content exclusions into {% data variables.product.prodname_vscode_shortname %}:
1. Access the Command Palette. For example, by pressing <kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd> (Mac) / <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux).
1. Type: `reload`.
1. Select **Developer: Reload Window**.
To reload content exclusions into your JetBrains IDE, either close and reopen the application, or log out of {% data variables.product.prodname_dotcom %} and then log back in, as follows.
1. Click the {% data variables.product.prodname_copilot_short %} icon in the status bar and select **Logout from {% data variables.product.prodname_dotcom %}**.
1. The {% data variables.product.prodname_copilot_short %} icon in the status bar will now have a diagonal line through it. Click it and select **Login to {% data variables.product.prodname_dotcom %}**.
1. The "Sign in to {% data variables.product.prodname_dotcom %}" message is displayed showing a device code. Click **Copy and Open**.
1. On the "Device Activation" page, paste in the device code and click **Continue**.
1. On the next page, click **Authorize {% data variables.product.prodname_copilot %} Plugin**.
### Azure DevOps `REPOSITORY-REFERENCE` support
Both the new (dev.azure.com) and old (visualstudio.com) formats for Azure DevOps are treated as equivalent in the `REPOSITORY-REFERENCE` syntax. You can use either host when specifying `REPOSITORY-REFERENCE`, and {% data variables.product.prodname_copilot_short %} will match them regardless of which host was used to clone the repository locally.
## Further reading
* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/reviewing-audit-logs-for-copilot-business)"
* "[AUTOTITLE](/enterprise-cloud@latest/copilot/troubleshooting-github-copilot/troubleshooting-common-issues-with-github-copilot#github-copilot-content-exclusions-are-not-being-applied)"

View File

@@ -1,7 +1,7 @@
---
title: Managing GitHub Copilot in your organization
shortTitle: Manage for organization
intro: "Organization owners can grant and revoke access to {% data variables.product.prodname_copilot %}, manage {% data variables.product.prodname_copilot_short %} related policies and features, as well as reviewing audit logs and usage data."
intro: 'Organization owners can subscribe to {% data variables.product.prodname_copilot_short %}, manage {% data variables.product.prodname_copilot_short %} for their organization, and control {% data variables.product.prodname_copilot_short %} policies.'
versions:
feature: copilot
redirect_from:
@@ -11,14 +11,8 @@ topics:
- Copilot
children:
- /subscribing-to-copilot-for-your-organization
- /granting-access-to-copilot-for-members-of-your-organization
- /managing-copilot-knowledge-bases
- /managing-requests-for-copilot-access-in-your-organization
- /revoking-access-to-copilot-for-members-of-your-organization
- /reviewing-usage-data-for-github-copilot-in-your-organization
- /managing-policies-and-features-for-copilot-in-your-organization
- /configuring-content-exclusions-for-github-copilot
- /reviewing-audit-logs-for-copilot-business
- /managing-access-to-github-copilot-in-your-organization
- /managing-github-copilot-features-in-your-organization
- /reviewing-github-copilot-activity-in-your-organization
- /canceling-copilot-for-your-organization
---

View File

@@ -11,6 +11,7 @@ redirect_from:
- /copilot/managing-copilot-for-business/managing-access-for-copilot-for-business-in-your-organization
- /copilot/managing-copilot-business/managing-access-for-copilot-business-in-your-organization
- /copilot/managing-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization
- /copilot/managing-copilot/managing-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization
topics:
- Copilot
---
@@ -86,6 +87,6 @@ You can use {% data variables.product.prodname_dotcom %}'s REST API to grant acc
## Further reading
* [{% data variables.product.prodname_copilot %} Trust Center](https://resources.github.com/copilot-trust-center)
* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization)"
* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization)"
* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)"
* "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-policies-for-copilot-in-your-organization)"
* "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization)"
* "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)"

View File

@@ -0,0 +1,13 @@
---
title: Managing access to GitHub Copilot in your organization
shortTitle: Manage access
intro: 'Organization owners can grant and revoke {% data variables.product.prodname_copilot_short %} access for members of their organization.'
versions:
feature: copilot
topics:
- Copilot
children:
- /granting-access-to-copilot-for-members-of-your-organization
- /managing-requests-for-copilot-access-in-your-organization
- /revoking-access-to-copilot-for-members-of-your-organization
---

View File

@@ -6,6 +6,8 @@ permissions: Organization owners
product: '{% data variables.product.prodname_copilot_business_short %}'
versions:
feature: copilot
redirect_from:
- /copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-requests-for-copilot-access-in-your-organization
topics:
- Copilot
---

View File

@@ -9,6 +9,7 @@ topics:
- Copilot
redirect_from:
- /copilot/managing-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization
- /copilot/managing-copilot/managing-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization
---
## How revoking access affects billing
@@ -45,4 +46,4 @@ You can use {% data variables.product.prodname_dotcom %}'s REST API to revoke ac
* [{% data variables.product.prodname_copilot %} Trust Center](https://resources.github.com/copilot-trust-center)
* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization)."
* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization)"
* "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization)"

View File

@@ -0,0 +1,80 @@
---
title: About content exclusions for GitHub Copilot
intro: 'Learn how content exclusions for {% data variables.product.prodname_copilot %} work.'
permissions: '{% data reusables.copilot.content-exclusion-permissions %}'
product: '{% data reusables.gated-features.copilot-business-and-enterprise %}'
versions:
feature: copilot
redirect_from:
- /copilot/managing-copilot-business/configuring-content-exclusions-for-github-copilot
- /copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot
- /copilot/managing-copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot
topics:
- Copilot
shortTitle: About content exclusions
---
{% data reusables.copilot.content-exclusion-note %}
You can configure {% data variables.product.prodname_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 {% data variables.product.prodname_copilot_chat %}'s responses.
{% data reusables.copilot.content-exclusions-delay %} See "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/testing-changes-to-content-exclusions-in-your-ide)."
## Availability of content exclusions
| Tool | Code completion support | {% data variables.product.prodname_copilot_chat_short %} support |
|--------|:--------:|:--------:|
| {% data variables.product.prodname_vs %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} |
| {% data variables.product.prodname_vscode %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} |
| JetBrains IDEs | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} |
| Vim/Neovim | {% octicon "check" aria-label="Supported" %} | Not applicable |
| Azure Data Studio | {% octicon "x" aria-label="Not supported" %} | Not applicable |
| {% data variables.product.prodname_dotcom_the_website %} | Not applicable | {% octicon "x" aria-label="Not supported" %} |
## Limitations of content exclusions
{% data reusables.copilot.content-exclusion-limitations %}
## 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 {% data variables.product.prodname_dotcom_the_website %}, or anywhere that can be accessed using any of the following syntaxes:
```text
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?
{% data reusables.copilot.content-exclusions-scope %}
{% ifversion fpt %}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 {% data variables.product.prodname_copilot_short %} seat as part of a {% data variables.product.prodname_copilot_business_short %} subscription.{% endif %}
{% ifversion ghec %}
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 {% data variables.product.prodname_copilot_short %} seat as part of a {% data variables.product.prodname_copilot_business_short %} or {% data variables.product.prodname_copilot_enterprise_short %} 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 {% data variables.product.prodname_dotcom %} or elsewhere, and the exclusion will apply to anyone who gets their {% data variables.product.prodname_copilot_business_short %} or {% data variables.product.prodname_copilot_enterprise_short %} 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.
{% endif %}
## Data sent to {% data variables.product.prodname_dotcom %}
After you configure content exclusion, the client (for example, the {% data variables.product.prodname_copilot_short %} extension for {% data variables.product.prodname_vscode_shortname %}) sends the current repository URL to the {% data variables.product.prodname_dotcom %} 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 "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/configuring-content-exclusions-for-github-copilot)."

View File

@@ -0,0 +1,136 @@
---
title: Configuring content exclusions for GitHub Copilot
intro: 'You can prevent {% data variables.product.prodname_copilot %} from accessing certain content.'
permissions: '{% data reusables.copilot.content-exclusion-permissions %}'
product: '{% data reusables.gated-features.copilot-business-and-enterprise %}'
layout: inline
versions:
feature: copilot
topics:
- Copilot
shortTitle: Configure content exclusions
---
{% data reusables.copilot.content-exclusions-availability-and-beta-note %}
## Configuring content exclusions for your repository
You can use your repository settings to specify content in your repository that {% data variables.product.prodname_copilot %} should ignore.
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
1. In the "Code & automation" section of the side bar, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}**.
If your repository inherits any exclusions from {%ifversion fpt %}its parent organization{% else %} organizations in the same enterprise{% endif %}, you'll see {%ifversion ghec %}one or more{% else %} a{% endif %} gray box{%ifversion ghec %}es{% endif %} at the top of the page containing details of these exclusions. You cannot edit these settings.
1. In the box following "Paths to exclude in this repository," enter the paths to files from which {% data variables.product.prodname_copilot_short %} should be excluded.
Use the format: `- "/PATH/TO/DIRECTORY/OR/FILE"`, with each path on a separate line. You can add comments by starting a line with `#`.
> [!TIP] {% data reusables.copilot.content-exclusion-fnmatch-tip %}
### Example of paths specified in the repository settings
```yaml annotate
# Ignore the `/src/some-dir/kernel.rs` file in this repository.
- "/src/some-dir/kernel.rs"
# Ignore files called `secrets.json` anywhere in this repository.
- "secrets.json"
# Ignore all files whose names begin with `secret` anywhere in this repository.
- "secret*"
# Ignore files whose names end with `.cfg` anywhere in this repository.
- "*.cfg"
# Ignore all files in or below the `/scripts` directory of this repository.
- "/scripts/**"
```
## Configuring content exclusions for your organization
You can use your organization settings to specify content in any Git repository that {% data variables.product.prodname_copilot %} should ignore.
{% data reusables.profile.access_org %}
{% data reusables.profile.org_settings %}
1. In the left sidebar, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}** then click **Content exclusion**.
1. In the box following "Repositories and paths to exclude," enter details of where {% data variables.product.prodname_copilot_short %} should be excluded.
For each repository in which you want files to be excluded from {% data variables.product.prodname_copilot_short %}, enter a reference to the repository on one line, followed by paths to locations within the repository, with each path on a separate line. Use the following format:
```yaml
REPOSITORY-REFERENCE:
- "/PATH/TO/DIRECTORY/OR/FILE"
- "/PATH/TO/DIRECTORY/OR/FILE"
- ...
```
Repositories can be referenced using various protocols. You can use any of the following syntaxes for `REPOSITORY-REFERENCE` and {% data variables.product.prodname_copilot_short %} will match them regardless of how the repository was cloned locally:
```text
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/
```
### Formatting tips for `REPOSITORY-REFERENCE`
* {% data reusables.copilot.content-exclusion-fnmatch-tip %}
* The `user@` and `:port` parts of the `REPOSITORY-REFERENCE` are ignored in the calculation of which paths to ignore for a repository.
* Each repository reference can contain a single `*` wildcard. For example, `https://github.com/octo-org/*` matches all repositories in the `octo-org` organization.
* For Azure DevOps, you can use the new (dev.azure.com) or old (visualstudio.com) host format when specifying `REPOSITORY-REFERENCE`, and {% data variables.product.prodname_copilot_short %} will match them regardless of which host was used to clone the repository locally.
### Example of repositories and paths in organization settings
```yaml annotate
# Ignore all `.env` files at any path, in any repository.
# This setting applies to all repositories, not just to those on GitHub.com.
# This could also have been written on a single line as:
#
# "*": ["**/.env"]
"*":
- "**/.env"
# In the `octo-repo` repository in this organization:
octo-repo:
# Ignore the `/src/some-dir/kernel.rs` file.
- "/src/some-dir/kernel.rs"
# In the `primer/react` repository on {% data variables.product.prodname_dotcom %}:
https://github.com/primer/react.git:
# Ignore files called `secrets.json` anywhere in this repository.
- "secrets.json"
# Ignore files called `temp.rb` in or below the `/src` directory.
- "/src/**/temp.rb"
# In the `copilot` repository of any {% data variables.product.prodname_dotcom %} organization:
git@github.com:*/copilot:
# Ignore any files in or below the `/__tests__` directory.
- "/__tests__/**"
# Ignore any files in the `/scripts` directory.
- "/scripts/*"
# In the `gitlab-org/gitlab-runner` repository on GitLab:
git@gitlab.com:gitlab-org/gitlab-runner.git:
# Ignore the `/main_test.go` file.
- "/main_test.go"
# Ignore any files with names beginning with `server` or `session` anywhere in this repository.
- "{server,session}*"
# Ignore any files with names ending with `.md` or `.mk` anywhere in this repository.
- "*.m[dk]"
# Ignore files directly within directories such as `packages` or `packaged` anywhere in this repository.
- "**/package?/*"
# Ignore files in or below any `security` directories, anywhere in this repository.
- "**/security/**"
```
## Next steps
To test your changes, see "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/testing-changes-to-content-exclusions-in-your-ide)."

View File

@@ -0,0 +1,16 @@
---
title: Managing GitHub Copilot features in your organization
shortTitle: Manage features
intro: 'Configure the function and availability of {% data variables.product.prodname_copilot %} features in your organization.'
versions:
feature: copilot
topics:
- Copilot
children:
- /managing-policies-for-copilot-in-your-organization
- /managing-copilot-knowledge-bases
- /about-content-exclusions-for-github-copilot
- /configuring-content-exclusions-for-github-copilot
- /testing-changes-to-content-exclusions-in-your-ide
- /reviewing-changes-to-content-exclusions-for-github-copilot
---

View File

@@ -12,6 +12,7 @@ redirect_from:
- /copilot/github-copilot-enterprise/copilot-chat-in-github/managing-copilot-knowledge-bases
- /copilot/github-copilot-chat/copilot-chat-in-github/managing-copilot-knowledge-bases
- /copilot/github-copilot-enterprise/managing-copilot-knowledge-bases
- /copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-copilot-knowledge-bases
---
{% ifversion fpt %}

View File

@@ -1,5 +1,5 @@
---
title: Managing policies and features for Copilot in your organization
title: Managing policies for Copilot in your organization
intro: 'Learn how to manage policies for {% data variables.product.prodname_copilot %} in your organization.'
permissions: Organization owners
product: '{% data reusables.gated-features.copilot-business-and-enterprise %}'
@@ -10,6 +10,7 @@ redirect_from:
- /copilot/managing-copilot-for-business/managing-policies-for-copilot-for-business-in-your-organization
- /copilot/managing-copilot-business/managing-policies-for-copilot-business-in-your-organization
- /copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization
- /copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization
topics:
- Copilot
shortTitle: Managing policies

View File

@@ -0,0 +1,42 @@
---
title: Reviewing changes to content exclusions for GitHub Copilot
intro: 'You can monitor changes to content exclusions in your repositories and organizations.'
permissions: 'Organization owners'
product: '{% data reusables.gated-features.copilot-business-and-enterprise %}'
versions:
feature: copilot
topics:
- Copilot
shortTitle: Review content exclusion changes
---
{% data reusables.copilot.content-exclusions-availability-and-beta-note %}
## Reviewing changes in your repository
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
1. In the "Code & automation" section of the side bar, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}**.
{% data reusables.copilot.view-last-change-content-exclusions %}
1. Click the time of the last change.
![Screenshot of the last edited information. The time of change link is highlighted with a dark orange outline.](/assets/images/help/copilot/content-exclusions-last-edited-by.png)
The "Audit log" page for the organization is displayed, showing the most recently logged occurrences of the `copilot.content_exclusion_changed` action in the repository.
{% data reusables.copilot.more-details-content-exclusion-logs %}
## Reviewing changes in your organization
{% data reusables.profile.access_org %}
{% data reusables.profile.org_settings %}
1. In the left sidebar, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}** then click **Content exclusion**.
{% data reusables.copilot.view-last-change-content-exclusions %}
1. Click the time of the last change.
![Screenshot of the last edited information. The time of change link is highlighted with a dark orange outline.](/assets/images/help/copilot/content-exclusions-last-edited-by.png)
The "Audit log" page for the organization is displayed, showing the most recently logged occurrences of the `copilot.content_exclusion_changed` action.
{% data reusables.copilot.more-details-content-exclusion-logs %}

View File

@@ -0,0 +1,102 @@
---
title: Testing changes to content exclusions in your IDE
intro: 'You can confirm your changes to content exclusions work as expected using your IDE.'
permissions: '{% data reusables.copilot.content-exclusion-permissions %}'
product: '{% data reusables.gated-features.copilot-business-and-enterprise %}'
versions:
feature: copilot
topics:
- Copilot
shortTitle: Test content exclusions
---
{% data reusables.copilot.content-exclusions-availability-and-beta-note %}
{% vscode %}
## Propagating content exclusion changes to {% data variables.product.prodname_vscode %}
In {% data variables.product.prodname_vscode_shortname %}, you can wait up to 30 minutes to see the effect of a settings change, or you can manually reload content exclusion settings as follows:
1. Access the Command Palette. For example, by pressing <kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd> (Mac) / <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux).
1. Type: `reload`.
1. Select **Developer: Reload Window**.
## Testing changes to content exclusions in {% data variables.product.prodname_vscode %}
After content exclusion changes propagate to {% data variables.product.prodname_vscode_shortname %}, the {% data variables.product.prodname_copilot_short %} icon indicates when {% data variables.product.prodname_copilot_short %} has been disabled by a content exclusion.
1. Open a file that you expect to be affected by your content exclusions.
If a {% data variables.product.prodname_copilot_short %} content exclusion applies to this file, the {% data variables.product.prodname_copilot_short %} icon in the status bar has a diagonal line through it.
1. Hover over the {% data variables.product.prodname_copilot_short %} icon. A popup message tells you whether an organization or the parent repository disabled {% data variables.product.prodname_copilot_short %} for this file.
![Screenshot of the {% data variables.product.prodname_copilot_short %} disabled popup in the {% data variables.product.prodname_vscode_shortname %} toolbar.](/assets/images/help/copilot/copilot-disabled-for-repo.png)
1. Optionally, you can also test content exclusions in {% data variables.product.prodname_copilot_chat_short %}. Open the {% data variables.product.prodname_copilot_chat_short %} window by clicking the {% data variables.product.prodname_copilot_chat_short %} icon in the activity bar.
![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} icon in the Activity Bar.](/assets/images/help/copilot/vsc-copilot-chat-icon.png)
{% data reusables.copilot.test-content-exclusions-chat %}
{% endvscode %}
{% visualstudio %}
## Propagating content exclusion changes to {% data variables.product.prodname_vs %}
In {% data variables.product.prodname_vs %}, you can wait up to 30 minutes to see the effect of a settings change, or you can manually reload the content exclusion settings by closing and reopening the application.
## Testing changes to content exclusions in {% data variables.product.prodname_vs %}
In {% data variables.product.prodname_vs %}, the {% data variables.product.prodname_copilot_short %} icon indicates when {% data variables.product.prodname_copilot_short %} has been disabled by a content exclusion.
1. Open a file that you expect to be affected by your content exclusions.
If a {% data variables.product.prodname_copilot_short %} content exclusion applies to this file, the {% data variables.product.prodname_copilot_short %} icon in the status bar has a diagonal line through it.
1. Hover over the {% data variables.product.prodname_copilot_short %} icon. A popup message tells you whether an organization or the parent repository disabled {% data variables.product.prodname_copilot_short %} for this file.
![Screenshot of the {% data variables.product.prodname_copilot_short %} disabled popup in the {% data variables.product.prodname_vscode_shortname %} toolbar.](/assets/images/help/copilot/copilot-disabled-for-repo.png)
{% endvisualstudio %}
{% jetbrains %}
## Propagating content exclusion changes to JetBrains IDEs
In supported JetBrains IDEs, you can wait up to 30 minutes to see the effect of a settings change, or you can manually reload the content exclusion settings by closing and reopening the application.
## Testing changes to content exclusions in JetBrains IDEs
In supported JetBrains IDEs, the {% data variables.product.prodname_copilot_short %} icon indicates when {% data variables.product.prodname_copilot_short %} has been disabled by a content exclusion.
1. Open a file that you expect to be affected by your content exclusions.
If a {% data variables.product.prodname_copilot_short %} content exclusion applies to this file, the {% data variables.product.prodname_copilot_short %} icon in the status bar has a diagonal line through it.
1. Hover over the {% data variables.product.prodname_copilot_short %} icon. A popup message tells you whether an organization or the parent repository disabled {% data variables.product.prodname_copilot_short %} for this file.
![Screenshot of the {% data variables.product.prodname_copilot_short %} disabled popup in the {% data variables.product.prodname_vscode_shortname %} toolbar.](/assets/images/help/copilot/copilot-disabled-for-repo.png)
1. Optionally, you can also test content exclusions in {% data variables.product.prodname_copilot_chat_short %}. Open the {% data variables.product.prodname_copilot_chat_short %} window by clicking the **{% data variables.product.prodname_copilot_chat_short %}** icon at the right side of the JetBrains IDE window.
![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} icon in the Activity Bar.](/assets/images/help/copilot/jetbrains-copilot-chat-icon.png)
{% data reusables.copilot.test-content-exclusions-chat %}
{% endjetbrains %}
{% vimneovim %}
## Propagating content exclusion changes to Vim/Neovim
If you are working in Vim/Neovim, content exclusions are automatically fetched from {% data variables.product.prodname_dotcom %} each time you open a file.
## Testing changes to content exclusions in Vim/Neovim
1. Open a file that you expect to be affected by your content exclusions.
1. Begin typing. If {% data variables.product.prodname_copilot %} no longer provides inline suggestions as you type, the file is excluded.
{% endvimneovim %}

View File

@@ -0,0 +1,12 @@
---
title: Reviewing GitHub Copilot activity in your organization
shortTitle: Review activity
intro: 'Understand how members of your organization use {% data variables.product.prodname_copilot %}.'
versions:
feature: copilot
topics:
- Copilot
children:
- /reviewing-usage-data-for-github-copilot-in-your-organization
- /reviewing-audit-logs-for-copilot-business
---

View File

@@ -7,6 +7,7 @@ redirect_from:
- /copilot/managing-copilot-business/reviewing-your-organization-or-enterprises-audit-logs-for-copilot-business
- /copilot/managing-github-copilot-in-your-organization/reviewing-your-organization-or-enterprises-audit-logs-for-copilot-business
- /copilot/managing-github-copilot-in-your-organization/reviewing-audit-logs-for-copilot-business
- /copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-audit-logs-for-copilot-business
versions:
feature: copilot
product: '{% data reusables.gated-features.copilot-audit-logs %}'

View File

@@ -9,6 +9,7 @@ topics:
- Copilot
redirect_from:
- /copilot/managing-github-copilot-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization
- /copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization
- /billing/managing-billing-for-github-copilot/viewing-your-github-copilot-usage
---
@@ -41,4 +42,4 @@ You can use {% data variables.product.prodname_dotcom %}'s REST API to get detai
* "[AUTOTITLE](/copilot/managing-copilot/managing-copilot-for-your-enterprise/viewing-copilot-usage-for-your-enterprise)"{% endif %}
* [{% data variables.product.prodname_copilot %} Trust Center](https://resources.github.com/copilot-trust-center)
* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization)."
* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)"
* "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)"

View File

@@ -20,6 +20,6 @@ redirect_from:
## Next steps
* Configure policies for {% data variables.product.prodname_copilot_short %} in your organization. See "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization)."
* Configure policies for {% data variables.product.prodname_copilot_short %} in your organization. See "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-policies-for-copilot-in-your-organization)."
* Grant {% data variables.product.prodname_copilot_short %} access to some or all members of the organization. See "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/managing-access-for-copilot-business-in-your-organization)."
* For billing information, see "[AUTOTITLE](/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot-business-and-github-copilot-enterprise)" and "[AUTOTITLE](/billing/managing-your-github-billing-settings)."