GITHUB-COPILOT practice question 3 of 15

What is the correct way to exclude specific files from being used by GitHub Copilot Business during code suggestions?

Full set: 65 questions
Answer options
A: Modify the .gitignore file to include the specific files.
B: Add the specific files to a copilot.ignore file.
C: Use the GitHub Copilot settings in the user interface to exclude files. Correct answer
D: Rename the files to include the suffix _no_copilot.
Correct Answer:
C. Use the GitHub Copilot settings in the user interface to exclude files.
Explanation

For GitHub Copilot Business and Enterprise, content exclusion is managed centrally through the GitHub user interface. Administrators can specify paths to files or directories within a repository's or organization's settings. This prevents GitHub Copilot from accessing the content of those files for any user working within that repository. This server-side configuration ensures that policies are enforced consistently across the organization, regardless of individual user settings. This feature is specifically designed for businesses to maintain control over which codebases are used for suggestions.

Why Incorrect

A. The .gitignore file is for Git source control and is explicitly not used by GitHub Copilot for content exclusion, as confirmed by official documentation.
B. There is no officially documented feature or configuration file named copilot.ignore for managing content exclusions in GitHub Copilot.
D. Renaming files with a specific suffix like nocopilot is not a recognized or supported method for excluding content from GitHub Copilot. ---

References

1. GitHub Docs. (2024). "Configuring content exclusions for GitHub Copilot." GitHub Enterprise Cloud Documentation.

Reference Section: The entire document describes the process. Specifically, the introduction states, "You can configure content exclusions for GitHub Copilot in the settings for your repository or organization." The section "About content exclusions for GitHub Copilot" clarifies, "The content exclusion settings for GitHub Copilot are not inherited from the .gitignore file." This directly supports option C and refutes option A. The document makes no mention of methods described in options B or D.

Scroll to Top