What the GitHub Foundations exam covers
- Understand Git and GitHub basics184 questions
- Work with GitHub repositories107 questions
- Collaborate using GitHub88 questions
- Apply modern development practices107 questions
- Manage projects with GitHub64 questions
- Understand privacy, security, and administration99 questions
- Explore the GitHub community63 questions
Free GitHub Foundations practice test questions
A sample of 10 questions with answers and explanations. A free account includes a fixed set of 20 practice questions for this exam, retryable anytime. Paid access unlocks the full 712-question bank.
-
What does a commit represent in Git?
- AA branch that points to the tip of the current line of work
- BA snapshot of changes with a message and unique hashCorrect
- CA remote server that stores the shared copy of the project
- DA tag that marks a released version with a friendly name
✓ Correct answer: BA commit records the state of the whole tree at one moment, together with author, timestamp, message and a pointer to its parent. Git identifies it by a SHA hash computed over that content, so the hash changes if anything in the commit changes - which is how Git detects tampering and why rewriting history produces new hashes.
Why the other options are wrong- AA branch is a movable pointer to commits, not the recorded snapshot itself.
- CA remote is where commits are stored and shared, not the commit object.
- DA tag labels a specific commit; it is not the snapshot that a commit represents.
-
A reviewer types '#' followed by a few characters of a title in an issue comment box on GitHub. What does this autocomplete help them do?
- AMention a specific user so that person is notified of the comment
- BInsert an emoji shortcode inline within the body of the comment
- CApply an existing label to the issue the comment is posted on
- DReference and link to another issue or pull request by numberCorrect
✓ Correct answer: DTyping # opens an autocomplete over the repository's issues and pull requests, matching on number or title, and inserts the reference. The result is a live link that shows the target's title and state, and it registers as a cross-reference on the other item.
Why the other options are wrong- ANotifying a user uses the '@' prefix, not '#'.
- BEmoji shortcodes use ':' delimiters, not the '#' autocomplete.
- CLabels are applied from the sidebar, not typed with '#' in a comment.
-
Which of these is a GitHub feature rather than a Git feature?
- APull requests, which propose and review a change before mergingCorrect
- BCommits, which record a set of changes with a message
- CBranches, which separate one line of work from another
- DMerges, which combine two lines of work back together
✓ Correct answer: ACommits, branches and merges are all part of Git and work with no network and no account anywhere. A pull request is a GitHub construct layered on top: it wraps a proposed merge in discussion, review and checks. Candidates who assume everything they use is Git are surprised when a pull request cannot be created from the command line without GitHub tooling.
Why the other options are wrong- BCommits are a core Git concept and work with no hosting service involved.
- CBranches are created and used by Git itself, independently of any service.
- DMerges are performed by Git and do not require a hosting service.
-
Which pair of constructs is most often confused, with the wrong one producing a formatted rather than verbatim result?
- AA block quote and a fenced code blockCorrect
- BA heading and a horizontal rule
- CA task list and a numbered list
- DAn inline link and a reference link
✓ Correct answer: AReaching for a block quote to show output is a frequent mistake, because it indents the text and looks deliberate while still interpreting formatting characters and reflowing lines, so the result differs from what was pasted. A fenced block is the construct that preserves content exactly. The other pairs differ in appearance rather than in whether contents are interpreted.
Why the other options are wrong- BA heading and a horizontal rule differ visibly and neither is used for verbatim content.
- CA task list and a numbered list both format their items and are rarely confused this way.
- DAn inline link and a reference link produce the same result by different syntax.
-
A reviewer selected "Request changes" on a pull request and then went on vacation. The branch requires approving reviews, and the change request is blocking an urgent merge. What is the appropriate way to unblock it without bypassing review policy?
- ASomeone with write access dismisses the blocking review with a comment, so other approvals countCorrect
- BThe author pushes a new commit, which clears the change request automatically
- CThe author re-requests review from the same reviewer, which resets the change request
- DAnother reviewer approves, and that approval overrides the change request
✓ Correct answer: AGitHub Docs state that if a reviewer who requests changes on a pull request isn't available, anyone with write permissions for the repository can dismiss the blocking review. Dismissing changes the status of the review to a review comment, and a comment explaining the dismissal is required, so the record stays on the pull request. That is the sanctioned route rather than disabling the protection rule.
Why the other options are wrong- BA new commit can dismiss stale approvals when that option is enabled, but it does not clear a change request; the review stands until the reviewer approves or it is dismissed.
- CRe-requesting review notifies the reviewer again, but the change request still blocks until they act or it is dismissed.
- DAn extra approval does not override the change request; it still blocks until that reviewer approves or the review is dismissed.
-
A maintainer creates a branch protection rule for main and enables none of the optional settings. What does the rule do by default?
- AIt requires at least one approving review before a pull request can merge
- BIt blocks force pushes to main and prevents main from being deletedCorrect
- CIt requires every commit pushed to main to carry a verified signature
- DIt requires all status checks to pass before changes can merge into main
✓ Correct answer: BEach branch protection rule starts by disabling force pushes to the matching branches and preventing them from being deleted, and both restrictions can be turned off. Everything else is an optional setting that has to be enabled, including required approving reviews, required status checks and required signed commits.
Why the other options are wrong- ARequired approving reviews come from an optional setting, Require pull request reviews before merging, that has to be enabled.
- CSigned commits are required only when the Require signed commits setting is enabled.
- DStatus checks are required only when the setting that requires them to pass before merging is enabled.
-
Which TWO lines in a .gitignore file cause Git to ignore files? (Choose TWO)
- Anode_modules/Correct
- B*.tmpCorrect
- C!debug.log
- D# build/
✓ Correct answer: A, BA pattern with a trailing slash such as node_modules/ matches only a directory, and everything beneath it is ignored. An asterisk matches anything except a slash, so *.tmp ignores files with that extension at any level. Lines that start with an exclamation mark or a hash do not add anything to the ignored set.
Why the other options are wrong- CA leading exclamation mark negates a pattern: it re-includes a file that an earlier pattern excluded, so it ignores nothing.
- DA line starting with a hash is a comment, so build/ is not ignored by this line.
-
You added a file to .gitignore, but Git keeps showing it as modified. Why?
- AThe .gitignore file has to be committed before its patterns take effect
- B.gitignore only applies to whole directories, never to individual files
- CThe pattern needs a leading slash to match a file in the repository root
- DThe file was already tracked before being added to .gitignoreCorrect
✓ Correct answer: D.gitignore only affects files Git is not already tracking. Once a file has been committed, Git keeps reporting changes to it regardless of any ignore pattern. Removing it from the index with git rm --cached, then committing that removal, is what makes the ignore rule take effect.
Why the other options are wrong- A.gitignore patterns apply as soon as the file exists in the working tree; committing it only shares the rules with others.
- B.gitignore matches individual files as well as directories.
- CA pattern without a slash matches at any level, including the root, so a missing leading slash does not stop it applying.
-
A bug report was filed as an issue, but the team decides it is really an open-ended question better suited to community Q&A. What feature lets them move it without retyping the content?
- AConvert the issue to a discussionCorrect
- BTransfer the issue to another repository
- CPin the issue
- DApply a 'question' label and lock the issue
✓ Correct answer: AConverting an issue to a discussion creates the discussion automatically from the issue's content, so nothing has to be retyped. Anyone with triage permissions for the repository can do it, and it is the moderation action GitHub provides for moving an open-ended conversation out of the issue tracker and into Discussions.
Why the other options are wrong- BTransfer moves the issue to a different repository's issue tracker; it stays an issue, not a discussion.
- CPinning highlights the issue in the issues list but keeps it an issue.
- DApplying a 'question' label and locking categorizes and freezes the issue but does not move it to Discussions.
-
What does an organization gain by enabling single sign-on with its identity provider?
- AMembers authenticate through the provider before reaching organization resourcesCorrect
- BMembers no longer need any GitHub account to contribute code
- CAccounts are created and removed automatically by SSO
- DMembers switch to accounts the company owns
✓ Correct answer: ASingle sign-on requires members to authenticate through the organization identity provider before they can reach its resources, which centralises access decisions and means suspending somebody in the provider blocks them here too. Their GitHub account still exists and their repository permissions are unchanged, so it is an authentication control rather than an authorisation one.
Why the other options are wrong- BMembers still hold a GitHub account; single sign-on governs how they authenticate with it.
- CSAML single sign-on controls sign-in; provisioning and deprovisioning need SCIM in addition.
- DCompany-owned accounts describe Enterprise Managed Users; with single sign-on members keep their own personal accounts.
Who this GitHub Foundations practice exam is for
This practice set is for anyone preparing for the GitHub Foundations exam at the foundational level - from first-time candidates building a foundation to experienced GitHub practitioners doing a final review before test day. If you learn best by working through realistic questions and reading why each answer is right or wrong, it is built for you.
How to use this GitHub Foundations practice exam
- Start with the free sample questions above to gauge your current baseline.
- Read the full explanation on every question, including why each wrong option is wrong.
- Track your weak domains and focus your study where you are losing the most marks.
- Once you are scoring consistently well, take a timed, full-length mock exam.
- Use your readiness score to decide when you are ready to book the real GitHub Foundations exam.
Related GitHub resources
- GitHub Foundations study guideKey concepts
- GitHub practice examsAll GitHub
- Certification pathWhere this fits
- Certification exam guides & tipsBlog
- Plans & pricingFree & paid
- How these questions are written and reviewedMethodology
- Report a problem with a questionCorrections
- GitHub Actions practice examRelated
- GitHub Advanced Security practice examRelated
- GitHub Copilot practice examRelated
GitHub Foundations practice exam FAQ
How many questions are in the GitHub Foundations practice exam on CertGrid?
CertGrid has 712 practice questions for GitHub Foundations, covering 7 exam domains. The real GitHub Foundations exam is ~60 qs in 100 min. CertGrid's timed mock is a fixed 60 questions.
What is the passing score for GitHub Foundations?
The GitHub Foundations exam passing score is 70%, and you have about 100 min to complete it. CertGrid scores your practice attempts the same way so you know when you are ready.
Are these official GitHub Foundations exam questions?
No. CertGrid is an independent practice platform. We do not provide real or leaked exam questions. Our questions are original and designed to help you practice the concepts, scenarios, and difficulty style of the GitHub Foundations exam.
Is there a free GitHub Foundations practice test?
Yes. You can take a free GitHub Foundations practice test straight away: a fixed set of 20 practice questions for this exam, retryable as often as you like, with no credit card required. You get readiness scoring and a weak-domain breakdown on those questions. Paid plans unlock the full 712-question bank, timed mock exams and full-bank domain analytics.
What CertGrid is (and is not)
CertGrid is an independent IT certification practice platform for Azure, AWS, Google, Cisco, Security, Linux, Kubernetes, Terraform, and other certification tracks. It provides objective-mapped practice questions, readiness scoring, weak-domain drills, and explanations to help learners understand what to study next.
Independent & original. CertGrid is an independent practice platform and is not affiliated with or endorsed by GitHub. Questions are original practice items designed to mirror certification concepts and exam style. CertGrid does not provide official exam questions or braindumps.