GH-300 practice question 3 of 10

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

Full set: 135 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

GitHub Copilot Business provides administrators with the ability to manage which files Copilot can use for code suggestions. This is achieved by configuring "content exclusions" within the repository's settings on the GitHub.com user interface. Administrators can specify paths to files or directories that should be ignored by Copilot. The content of these specified files will not be used to inform code completion suggestions, ensuring that sensitive or irrelevant code is excluded from the model's context.

Why Incorrect

A. The .gitignore file is used by the Git version control system to determine which files or directories should be ignored and not tracked, it does not control GitHub Copilot's behavior.
B. A copilot.ignore file is not a recognized or supported configuration file for managing GitHub Copilot's content exclusions.
D. Renaming files is not a standard or scalable method for managing content exclusions; it is a manual workaround, not a built-in feature. ---

References

1. GitHub Docs. (n.d.). Configuring content exclusions for GitHub Copilot. GitHub. Retrieved from https://docs.github.com/en/copilot/managing-copilot-business/configuring-content-exclusions-for-github-copilot.

Reference Details: The section "Configuring content exclusions in your repository settings" explicitly states: "You can configure GitHub Copilot to ignore files in your repository. You do this by specifying excluded paths in the repository's settings... On GitHub.com

navigate to the main page of the repository. Under your repository name

click Settings... In the 'Code & automation' section of the sidebar

click Copilot." This confirms that the user interface settings are the correct method.

Scroll to Top