Skip to content

GitHub Foundations Practice Questions

Prepare for GH-900 with more than an answer.

250 questions in the full set17 sample questionsUpdated Jan 25, 2026
Exam fee
$99 USD
Level
Foundational
Valid for
2 years
Domains covered on the exam 7
  1. Introduction to Git and GitHub22%
  2. Working with GitHub Repositories8%
  3. Collaboration Features30%
  4. Modern Development13%
  5. Project Management7%
  6. Privacy, Security, and Administration10%
  7. Benefits of the GitHub Community10%
  1. 1

    An organization wants to standardize the structure of all new microservice repositories. They require every new repository to start with a specific folder structure, a standard .gitignore, and a pre-populated README.

    What is the most efficient GitHub feature to achieve this?

    Show answer details

    Correct answer: D

    Repository templates allow you to define a boilerplate repository. When a user creates a new repository, they can choose to 'Use this template', which copies the directory structure and files into the new project without carrying over the entire commit history.

  2. 2

    You are managing a repository that contains a legacy project. The project is no longer actively developed, but the code must remain accessible for reference. You want to prevent any new issues, pull requests, or commits from being created.

    Which repository setting should you configure?

    Show answer details

    Correct answer: C

    Archiving a repository puts it into a read-only state. It remains available to everyone who had access, but no one (including admins) can create issues, pull requests, or push code. It can be un-archived later if necessary.

  3. 3

    You need to upload a large dataset file (75MB) to a GitHub repository using the web interface in a browser.

    What is the outcome of this action?

    Show answer details

    Correct answer: C

    While Git LFS allows larger files, the standard GitHub web interface restricts file uploads to 25MB. To upload files larger than 25MB (up to 100MB standard or more with LFS), you must use the command line.

  4. 4

    A user wants to quickly fix a typo in a file within a repository they do NOT have write access to. They navigate to the file on GitHub and click the 'Edit' (pencil) icon.

    What happens next?

    Show answer details

    Correct answer: A

    If you try to edit a file in a repository where you lack write permissions, GitHub's UI automatically forks the repository to your account (if you don't have one already) and opens the editor so you can commit the change to your fork and subsequently create a Pull Request.

  5. 5

    You have opened a Pull Request that is not yet ready for review. You want to indicate its work-in-progress status and prevent it from being accidentally merged.

    What is the most appropriate feature to use?

    Show answer details

    Correct answer: A

    Draft Pull Requests are a native feature. They cannot be merged until they are marked as 'Ready for Review'. This explicitly signals the status to the team and technically blocks the merge button.

  6. 6

    A development team is transitioning from a centralized version control system to Git and GitHub. They are confused about the distributed nature of Git compared to their previous system.

    Which statement accurately describes the fundamental architectural difference regarding repository history in this transition?

    Show answer details

    Correct answer: D

    Git is a distributed version control system (DVCS). When a developer clones a repository, they receive a full backup of all data, including the entire commit history, branches, and tags. This allows operations like log viewing and diffing to happen locally without a network connection, unlike centralized systems where history resides primarily on the server.

  7. 7

    You have initialized a new local project and created several files. You want to save the current state of your project to your local Git history.

    Which sequence of commands represents the correct workflow to permanently record these changes in the local repository?

    Show answer details

    Correct answer: D

    The standard Git workflow involves two steps: first, staging the changes using git add (which moves files from the working directory to the staging area), and second, committing those staged changes to the local repository history using git commit. Pushing is a separate step to sync with a remote.

  8. 8

    A developer attempts to push local commits to a remote repository but receives a 'non-fast-forward' error. This indicates that the remote branch contains commits that are not present locally.

    What is the safest command to resolve this situation without losing history, assuming the developer wants to incorporate the remote changes before pushing?

    Show answer details

    Correct answer: A

    A git pull performs a git fetch followed by a git merge. This downloads the new commits from the remote and merges them into the local branch. Once the merge is resolved (and any conflicts fixed), the local history includes the remote work, allowing a standard git push to succeed. git push --force would overwrite remote history, potentially causing data loss for others.

Create an account to continue.