Use GitHub Copilot features
Drill 20 practice questions focused entirely on Use GitHub Copilot features for the GitHub GH-300 exam. Tap an answer for instant feedback and a full explanation — no sign-up, always free.
A developer uses Copilot agent mode in VS Code to implement a new feature that spans several files. After the agent generates the changes and runs the build task, the compiler reports errors. What does agent mode do next as part of its normal workflow?
A developer is using Copilot agent mode in VS Code to implement a feature. As part of completing the task, the agent proposes running a terminal command to install a dependency and run the build. The developer wants to maintain control over what actually executes in their environment. By default, how does agent mode handle terminal commands it generates during a task?
A developer needs Copilot to implement a new REST endpoint that requires creating a controller, updating the router, adding a service method, running the test suite, and iterating on failures until the tests pass — all with minimal manual step-by-step direction. Which VS Code Copilot capability is designed to autonomously plan the work, edit multiple files, and run terminal commands within an agentic loop to accomplish this?
You are the GitHub Enterprise admin for a company that just enabled GitHub Copilot Business across several organizations. Your compliance team needs to verify, through the enterprise audit log, whenever an administrator changes which repositories or file paths are excluded from Copilot (content exclusion settings). Which approach correctly surfaces these changes?
As an organization owner, you need to provide your security team with a machine-readable record of Copilot-related administrative activity—such as when Copilot policies were changed and when seats were assigned or removed—so they can ingest it into their SIEM for long-term retention beyond the default retention window. Which approach best meets this requirement?
A backend team wants every developer to be able to trigger a consistent, reusable Copilot Chat prompt that generates a REST endpoint following their internal conventions (naming, error format, logging). They want this prompt versioned in the repository so it stays in sync with their standards and can be invoked directly from the Chat input in VS Code. Which Copilot feature should they use?
A developer is working in VS Code and highlights a single method that throws an unexpected exception at runtime. They want to ask Copilot a focused question about just that method and apply a fix directly at the cursor location without leaving the editor context or opening a separate side panel. Which Copilot Chat interface should they use?
A developer using Copilot Chat in VS Code wants to ask questions about the repository's open issues and pull requests directly from the chat window—for example, summarizing a specific issue or listing recent PRs—without leaving the editor. Which Copilot Chat feature should they use to scope the conversation to GitHub's repository data?
A developer working in Visual Studio Code is using Copilot Chat to ask a question about how authentication is implemented across their project. They want Copilot to consider the entire codebase in the open project—not just the currently open file—when generating its answer. Which approach lets them scope the chat request to the full project context?
A developer has selected a complex block of legacy JavaScript in VS Code and wants Copilot Chat to produce a plain-language description of what the highlighted code does, without generating new code or tests. Which Copilot Chat slash command is the most appropriate to invoke for this task?
A developer has installed the GitHub Copilot CLI extension via the GitHub CLI and wants to invoke Copilot's command explanation feature using a short custom alias (for example, typing `copilot explain 'tar -xzf'` instead of the full `gh copilot explain` command). They also want tab-completion and the alias to persist across new terminal sessions. Which approach correctly sets this up?
You have just installed the GitHub Copilot CLI extension on a new workstation and want to start generating command suggestions from the terminal. When you run your first `gh copilot suggest` command, you receive an authentication error. What is the correct step to resolve this so the CLI can access your Copilot subscription?
A DevOps engineer inherits a maintenance script full of unfamiliar shell commands. They want to use GitHub Copilot in the CLI to get a plain-language breakdown of what a specific complex command (for example, a long tar and find pipeline) actually does, without generating or executing anything new. Which Copilot CLI capability is designed for this purpose?
A DevOps engineer is using the GitHub Copilot CLI in an interactive session and asks it to suggest a command to find and delete all log files older than 30 days. Copilot returns a command, but the engineer realizes it should also exclude files in a specific archive directory. Instead of starting a completely new query, what is the most efficient way to refine the result within the same interactive Copilot CLI session?
You are working in a terminal and want GitHub Copilot in the CLI to explain what a suggested git command will do before you run it. After running the command suggestion, Copilot presents a proposed shell command in interactive mode. Which action lets you have Copilot walk you through what the command does without executing it?
A platform engineer wants to integrate GitHub Copilot in the CLI into a shell automation script that generates a suggested git command for a given natural-language task, captures the output, and pipes it into a logging step — all without any interactive prompts or a terminal UI. Which approach correctly supports this scripted, non-interactive use of the Copilot CLI?
You are using GitHub Copilot in the CLI (via the `gh copilot suggest` command) inside a terminal session on a Linux server. You want Copilot to help you write a suggestion, but you specifically need it to produce a command that can be run in a Git repository context rather than a generic shell command or a GitHub CLI (gh) command. When you run `gh copilot suggest` interactively, how can you ensure the suggestion is tailored to this need?
Your team wants Copilot code review to consistently flag missing input validation and enforce your project's naming conventions whenever a reviewer requests a review on a pull request. You want these expectations applied automatically across all reviews in the repository without repeating them manually each time. What should you configure?
As an organization owner, you want every repository in your GitHub organization to have Copilot automatically requested as a reviewer on new pull requests, without requiring each developer to manually add it. Where do you configure this so that automatic Copilot code review applies across the organization's repositories?
A backend team wants to get an automated first-pass review on their pull requests before human reviewers look at them. They want Copilot to leave review comments directly on the PR diff, flagging potential issues in the changed code. Which capability should they use, and how is it triggered on a pull request in GitHub.com?
More GH-300 practice
Keep going with the other GitHub Copilot domains, or take a full timed mock exam.
← Back to GH-300 overview