Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free Microsoft GitHub Foundations GH-900 Exam Questions

Last updated: · 10 practice questions with answers and explanations

Page: 1 / 12 Total 179 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Understand Git and GitHub basics

Skill tested: Apply GitHub Flow by branching, committing, reviewing, and merging a feature change.

A product team maintains a GitHub repository with a protected default branch. Developers must deliver small features without disrupting work already merged by teammates. For a new feature, one developer needs an isolated workspace, wants reviewers to discuss the proposed change before it becomes part of the default branch, and must keep the default branch as the source of the deployed version. Which sequence best follows GitHub Flow?

Correct Answer: C. Create a feature branch from the default branch, commit the work there, open a pull request, address review feedback, and merge the approved pull request into the default branch.
Explanation:

GitHub Flow keeps the deployable default branch separate from work in progress. A developer creates a branch from the default branch, commits the change on that branch, and uses a pull request to invite review and discussion before merging. Review feedback can be incorporated on the same branch. Committing directly to the default branch bypasses the requested review; merging before review reverses the required order. A fork is useful when a contributor lacks write access, but it is unnecessary for this developer's stated workflow.

Question 2

New Single answer

Topic: Understand Git and GitHub basics

Skill tested: Choose a Git operation that reconciles a feature branch with newer default-branch commits.

A team has a long-lived feature branch, and several reviewed changes have since been merged into the repository's default branch. Before opening a pull request, the developer wants the feature branch to include those latest changes while preserving the branch's existing commit history; rewriting published commits is prohibited by team policy. Which action is most appropriate?

Correct Answer: A. Merge the current default branch into the feature branch.
Explanation:

Merging the updated default branch into the feature branch incorporates its newer commits while retaining the existing commit history, which meets the no-rewrite constraint. Rebasing can create a linear history, but it rewrites the feature commits and conflicts with the stated policy; force-pushing compounds that issue. Resetting discards the feature branch's commits unless they are carefully recreated, and simply merging the pull request without updating the branch does not perform the requested reconciliation.

Question 3

New Single answer

Topic: Understand Git and GitHub basics

Skill tested: Interpret commit history to identify how a branch diverged from its base.

During a code review, a developer sees a pull request that contains an unexpected change. The branch was created before two other pull requests were merged into the default branch, and its author says the unexpected change was already present when the branch was created. The team wants to establish whether the branch contains that change as part of its own work before discussing a fix. What should the reviewer inspect first?

Correct Answer: D. The pull request's commit list and branch comparison against the current base branch.
Explanation:

The pull request's commits and comparison with its base branch show which changes the branch proposes relative to the current base. Reviewing those records is the direct way to distinguish branch-specific commits from changes already present in the base history. A README may describe project usage but does not record branch ancestry. A license and branch protection settings likewise do not establish the contents or divergence point of a particular branch.

Question 4

New Single answer

Topic: Work with GitHub repositories

Skill tested: Use CODEOWNERS to designate reviewers for changes to sensitive repository paths.

A repository contains application code and a `/security/` directory holding authentication configuration. The organization wants changes to that directory to be routed to the security team for review, while keeping the repository open to normal contributions. The security team must be identified by a GitHub username or team mention. Which repository change best meets the requirement?

Correct Answer: B. Add a `CODEOWNERS` file with an entry mapping `/security/` to the security team's `@org/security` handle.
Explanation:

A `CODEOWNERS` file maps file paths to designated owners, allowing the security team to be requested for review when a change affects `/security/`. This directly supports the requested path-specific review routing without restricting who can contribute. A README or CONTRIBUTING guide can explain a process, but neither provides the same ownership mapping. Renaming a directory does not create branch protection or review requirements.

Question 5

New Single answer

Topic: Collaborate using GitHub

Skill tested: Link a pull request to an issue so merging can close the tracked work item.

A maintenance team tracks defects as GitHub issues. For a fix, they want the pull request to show the related issue and have the issue close automatically when the pull request is merged into the repository's default branch. The team does not want maintainers to close the issue manually or rely on a reviewer remembering to do so. What should the pull request author do?

Correct Answer: D. Use a closing keyword with the issue reference in the pull request description, such as `Fixes #84`.
Explanation:

A supported closing keyword such as `Fixes #84` in the pull request description links the issue and closes it when the pull request is merged into the repository's default branch. A bare issue mention links the items but does not itself declare that the issue should close. Labels classify work rather than establish closing behavior, and a discussion is not a substitute for the pull request's issue-closing reference.

Question 6

New Multiple answers

Topic: Collaborate using GitHub

Skill tested: Select issue templates and notification controls that improve contribution intake and triage.

An open-source project receives bug reports with missing reproduction details and feature requests mixed into the same unstructured issue stream. Maintainers want submitters to provide consistent information, let users discover relevant reports without changing issue data, and reduce notifications to those about discussions they follow. Select TWO actions that directly meet these needs. Select two answers.

Correct Answer: D. Use notification settings to limit which repository conversations generate notifications for a user.; E. Create issue templates that prompt bug reporters for reproduction steps and feature requesters for their goals.
Explanation:

Issue templates can guide reporters to provide the information maintainers need and can distinguish bug reports from feature requests. Notification settings let users control which repository activity generates notifications, reducing noise without affecting issue content. Search filters are useful for discovery and triage, but they do not change how new reports are submitted or limit notifications. Forking is unrelated to issue reporting, and subscribing everyone to every issue would increase rather than reduce notification volume.

Question 7

New Single answer

Topic: Apply modern development practices

Skill tested: Select Codespaces when a task requires a reproducible cloud development environment.

A new engineer must make a change to a repository that requires several project-specific tools and extensions. The team has configured a development container for the repository, and the engineer's laptop cannot install the required software because of company policy. The engineer needs a fully configured, cloud-hosted development environment rather than only a browser-based editor. Which choice best fits?

Correct Answer: D. Use GitHub Codespaces to create a cloud development environment configured from the repository's development-container settings.
Explanation:

Codespaces provides a cloud-hosted development environment and can use repository development-container configuration to supply project tools without installing them on the engineer's laptop. `github.dev` is a browser-based editor suited to lightweight edits, but it does not provide the same full cloud-hosted development environment. Actions automates workflows such as builds and tests rather than serving as an interactive workstation, and Discussions is for collaboration, not development tooling.

Question 8

New Single answer

Topic: Manage projects with GitHub

Skill tested: Use milestones to group issues and pull requests toward a planned delivery target.

A release manager is coordinating a set of GitHub issues and pull requests for a quarterly release. The team needs one shared target date and a way to monitor how much of that release work has been completed. Work items retain their existing labels, and the manager does not want to create a separate repository or manually summarize every item. Which project-management feature is the best fit?

Correct Answer: A. Create a milestone for the release, assign the relevant issues and pull requests to it, and track its progress.
Explanation:

A milestone groups related issues and pull requests around a target date and provides a way to track their completion, making it appropriate for release planning. Saved replies speed up repeated comments but do not organize or measure work. Repository templates create starting points for repositories, not release tracking, and CODEOWNERS assigns responsibility for paths rather than grouping delivery work.

Question 9

New Multiple answers

Topic: Understand privacy, security, and administration

Skill tested: Apply least-privilege repository roles and branch protection controls to protect reviewed changes.

A company hosts a private application repository. Contractors need to propose changes but must not push directly to the default branch. The company also requires that changes to that branch pass a pull request review before they can be merged. The repository is not part of an enterprise-managed user deployment. Select TWO actions that satisfy these requirements. Select two answers.

Correct Answer: B. Configure branch protection for the default branch to require pull requests and the required review before merging.; E. Give contractors repository access that permits them to contribute on branches or through pull requests, but not administer repository settings.
Explanation:

Least-privilege repository access lets contractors contribute without granting administrative authority, while branch protection can require pull requests and reviews before changes reach the default branch. Public visibility would expose the repository and does not by itself grant outside contributors write access. Administrator access is excessive and undermines the access constraint. Two-factor authentication strengthens account security, but it does not control which branches a user can push to or replace branch protection.

Question 10

New Multiple answers

Topic: Explore the GitHub community

Skill tested: Distinguish forks, repository templates, and Marketplace integrations for community reuse.

A developer relations group is preparing a public demonstration repository. Community members should be able to create independent copies and propose improvements upstream, while organizations that want to start a separate project should be able to generate a fresh repository from the same starter files. The team also wants to find a third-party integration that automates release notes. Select TWO GitHub features that directly support these goals. Select two answers.

Correct Answer: B. Use repository templates so users can create new repositories from the starter structure without treating them as forks.; E. Use forks for community members who want to develop independently and contribute changes back through pull requests.
Explanation:

Forks create independent repository copies that support contribution back to the original project, commonly through pull requests. A repository template lets users generate a new repository from starter files without establishing a fork relationship. Milestones track groups of work, while GitHub Sponsors supports funding open-source developers and projects. CODEOWNERS assigns review responsibility; it does not publish or discover integrations. The Marketplace is where integrations can be discovered, but it is not one of the two choices that accomplishes the stated copying goals.