GitHub Flow Beginner Quiz
30 questions on GitHub Flow.
Question 1: What is GitHub?
- A. A command-line interface tool for Git
- B. A cloud-based hosting service that lets you manage Git repositories β (correct answer)
- C. A programming language
- D. A database server
Explanation: While Git is the version control software, GitHub is the online platform that hosts your repositories and provides collaboration tools.
Question 2: What is the fundamental rule of the GitHub Flow?
- A. Never use branches
- B. Always commit directly to the
main branch
- C. The
main branch must always be deployable β (correct answer)
- D. Only senior developers can merge code
Explanation: GitHub Flow requires that anything in the main branch is tested, stable, and ready to be deployed to production at any time.
Question 3: According to GitHub Flow, what is the first step when starting a new feature or fixing a bug?
- A. Write the code directly in
main
- B. Create a new branch off of
main with a descriptive name β (correct answer)
- C. Create a Pull Request
- D. Delete the repository
Explanation: Creating a branch (like feature/login or fix/header-bug) isolates your work from the stable main branch.
Question 4: What does it mean to "Fork" a repository on GitHub?
- A. Deleting the repository
- B. Creating a personal copy of someone else's project on your own GitHub account β (correct answer)
- C. Merging two branches together
- D. Downloading the code as a ZIP file
Explanation: Forking allows you to freely experiment and make changes without affecting the original project. It is the core of open-source contribution.
Question 5: What is a Pull Request (PR)?
- A. A request to download code from GitHub to your local machine
- B. A mechanism to notify team members that a feature is ready for code review and merge into the main branch β (correct answer)
- C. A request to delete a repository
- D. A tool for forcing a server to reboot
Explanation: A Pull Request literally asks the repository owner to "pull" your changes into their codebase. It is the central place for discussion and review.
Question 6: In GitHub Flow, when should you open a Pull Request?
- A. Only after the code is 100% finished and perfect
- B. As soon as you create the branch, even if you are just starting, to gather early feedback β (correct answer)
- C. After you have merged it into
main
- D. Never
Explanation: Opening a "Draft" Pull Request early allows teammates to see what you are working on and provide architectural advice before you go too far down the wrong path.
Question 7: What happens if you push a new commit to a branch that already has an open Pull Request?
- A. You must close the old PR and open a new one
- B. The PR is automatically updated with your new commits β (correct answer)
- C. Git throws an error
- D. The PR is automatically merged
Explanation: Pull Requests track the branch, not specific commits. Any new commits pushed to that branch automatically appear in the PR.
Question 8: What is the purpose of a "Code Review"?
- A. To make fun of other developers' code
- B. To ensure code quality, catch bugs early, share knowledge, and maintain project standards before merging β (correct answer)
- C. To compile the code into an executable
- D. To test the UI design
Explanation: Code reviews are a collaborative step in GitHub Flow where peers examine your PR, leave comments, and suggest improvements.
Question 9: What are GitHub "Issues"?
- A. Errors in the Git installation
- B. A built-in tracking system to organize tasks, report bugs, and request features β (correct answer)
- C. Server downtime notices
- D. Security vulnerabilities in GitHub
Explanation: Issues act like a lightweight project management tool (similar to Jira or Trello) directly tied to your repository.
Question 10: How can you automatically close an Issue using a Pull Request?
- A. By emailing the repository owner
- B. By writing "Fixes #42" or "Closes #42" in your commit message or PR description β (correct answer)
- C. By deleting the issue manually
- D. By assigning the issue to yourself
Explanation: GitHub recognizes specific keywords. When the PR is merged, the linked Issue is automatically closed.
Question 11: What does the "Merge Pull Request" button do?
- A. It deletes the PR
- B. It integrates the changes from your feature branch directly into the
main branch β (correct answer)
- C. It downloads the code to your local machine
- D. It creates a new branch
Explanation: Once approved, clicking Merge safely applies all your changes to the stable codebase.
Question 12: According to GitHub Flow, what should you do immediately after your Pull Request is merged into main?
- A. Take a long vacation
- B. Delete the feature branch and deploy the
main branch β (correct answer)
- C. Keep the branch open for future edits
- D. Un-merge it
Explanation: Deleting the branch keeps the repository clean. Because main is now updated with your stable code, it is ready for deployment.
Question 13: What is a "Merge Conflict" in a Pull Request?
- A. When GitHub servers crash
- B. When two people edit the exact same lines of code differently, and Git cannot automatically determine which version to keep β (correct answer)
- C. When a user forgets their password
- D. When the PR description is too short
Explanation: Merge conflicts must be resolved manually by a developer before the PR can be merged.
Question 14: What is a "Draft" Pull Request?
- A. A PR that has been deleted
- B. A PR that signals the work is still in progress and prevents accidental merging β (correct answer)
- C. A PR that only contains text files
- D. A PR that bypasses code review
Explanation: Draft PRs are great for "work in progress" (WIP) code where you want feedback but know it is not ready for production.
Question 15: What are GitHub Actions?
- A. Shortcuts for Git commands
- B. A built-in CI/CD platform that allows you to automate software workflows (like testing or deployment) directly in your repository β (correct answer)
- C. Emojis you can leave on PR comments
- D. A physical button on your keyboard
Explanation: GitHub Actions can be configured to automatically run your test suite every time someone pushes to a Pull Request.
Question 16: What does it mean to "Squash and Merge" a Pull Request?
- A. It compresses the files to save server space
- B. It combines all the individual commits from the feature branch into one single, clean commit on the
main branch β (correct answer)
- C. It deletes the branch without merging
- D. It ignores merge conflicts
Explanation: Squashing prevents your main branch history from being cluttered with hundreds of minor commits like "fixed typo" or "WIP".
Question 17: What does it mean if a Pull Request says "Cannot merge automatically"?
- A. The repository is locked
- B. There is a Merge Conflict that must be resolved locally or via the web editor before merging β (correct answer)
- C. You do not have internet access
- D. The branch name is invalid
Explanation: You must pull the latest main branch into your feature branch and manually fix the overlapping lines of code.
Question 18: What is the purpose of the README.md file in a GitHub repository?
- A. It acts as the primary configuration file for GitHub Actions
- B. It is the front page of the repository, providing documentation on what the project is and how to use it β (correct answer)
- C. It stores passwords securely
- D. It is a log of all commit messages
Explanation: A good README is crucial for open-source projects so other developers understand how to install and contribute.
Question 19: What is a "Release" on GitHub?
- A. Deleting the repository
- B. A packaged, versioned snapshot of your software (e.g., v1.0.0) usually bundled with release notes and compiled binaries β (correct answer)
- C. Removing a collaborator
- D. Merging a PR
Explanation: Releases are tied to Git Tags and make it easy for users to download stable versions of your software.
Question 20: How can you suggest a direct code change in a Pull Request review without requiring the author to type it out themselves?
- A. Use the "Suggest Changes" feature block in your comment, which provides a button for them to commit it instantly β (correct answer)
- B. Email them the file
- C. Delete their PR and create a new one
- D. You must push directly to their branch
Explanation: Typing `suggestion inside a PR comment creates a visual diff that the author can accept with one click.
Question 21: If you are contributing to an open-source project you do not have write access to, how do you submit your code?
- A. Email the code to the owner
- B. Ask for their password
- C. Fork the repository, make changes on your fork, and submit a Pull Request back to the original repository β (correct answer)
- D. Push directly to their
main branch
Explanation: This is the standard open-source workflow. Forking gives you a sandbox, and the PR bridges the gap back to the main project.
Question 22: What does a "Rebase and Merge" do?
- A. It deletes the PR
- B. It rewrites the commit history by placing all feature branch commits directly at the tip of
main, creating a perfectly linear history without a merge commit β (correct answer)
- C. It squashes all commits into one
- D. It reverts the last commit
Explanation: Unlike a standard merge, rebasing keeps the project history looking like a straight line, which some teams prefer for readability.
Question 23: What is a "Reviewer" in a Pull Request?
- A. A bot that checks for viruses
- B. A team member specifically requested to look over the code, provide feedback, and approve or request changes β (correct answer)
- C. The person who wrote the code
- D. The server administrator
Explanation: Reviewers act as quality control. Many repositories require at least one approving review before a PR can be merged.
Question 24: What does it mean to "Request Changes" on a PR?
- A. You are asking the author to rewrite the entire app
- B. You are blocking the merge until the author fixes specific issues you highlighted in your review β (correct answer)
- C. You are requesting GitHub to alter the UI
- D. You are reverting a merge
Explanation: "Request Changes" applies a red 'X' to the PR, signaling that it is not yet safe to merge.
Question 25: What is the CONTRIBUTING.md file used for?
- A. Storing donor credit card information
- B. Outlining the rules, guidelines, and steps required for outside developers to contribute to the project β (correct answer)
- C. A list of active developers
- D. The project's license
Explanation: This file tells contributors how to format their code, how to run tests, and what the PR process looks like.
Question 26: What are "Branch Protection Rules"?
- A. Rules that prevent branches from being downloaded
- B. Settings configured by admins to enforce workflows (e.g., requiring passing status checks or mandatory code reviews before merging into
main) β (correct answer)
- C. Encryption for specific branches
- D. Rules that hide branches from the public
Explanation: Branch protection prevents developers from accidentally pushing broken code directly to main without review.
Question 27: What is a "Status Check" in a Pull Request?
- A. A check to see if the developer is online
- B. Automated tests or CI/CD pipelines that run against the PR code to verify it doesn't break the build β (correct answer)
- C. A manual checklist written in the PR description
- D. A server ping
Explanation: If a status check fails (e.g., a unit test fails), the PR will show a red X, warning reviewers that the code is broken.
Question 28: What is the purpose of the .github/CODEOWNERS file?
- A. It transfers legal ownership of the code
- B. It automatically requests reviews from specific team members whenever files they "own" are modified in a PR β (correct answer)
- C. It tracks who wrote the most lines of code
- D. It prevents anyone else from looking at the code
Explanation: If you modify database.js, the CODEOWNERS file can automatically assign the Database Lead to review your PR.
Question 29: How do you keep your Forked repository up to date with the original repository?
- A. You have to delete your fork and fork it again
- B. You configure an "upstream" remote pointing to the original repo, fetch the changes, and merge them into your local main branch β (correct answer)
- C. GitHub automatically syncs it every hour
- D. You copy and paste the code manually
Explanation: While GitHub now has a "Sync fork" UI button, the Git way is to add an upstream remote (git remote add upstream URL) and pull from it.
Question 30: What does it mean to "Revert" a merged Pull Request?
- A. It deletes the PR from GitHub history
- B. It creates a brand new commit that undoes all the changes introduced by that specific PR β (correct answer)
- C. It un-merges the PR and puts the code back into a branch
- D. It deletes the repository
Explanation: Because you cannot rewrite public history in main, a "Revert" safely negates the bad code by applying the exact opposite changes in a new commit.