GitHub Foundation Certification Preparation Guide with Practice Questions

Muhammad HassanMuhammad Hassan
33 min read

Preparing for the GitHub Foundation Certification exam can be a rewarding experience, especially if you're looking to enhance your skills in Git and GitHub. This guide provides a comprehensive list of questions and answers to help you study effectively.

1. Difference Between git clone, git fetch, and git pull

Definition:

  • git clone: Creates a copy of a repository on your local machine.

  • git fetch: Retrieves updates from the remote repository without merging.

  • git pull: Fetches updates from the remote and merges them into your current branch.

Example:

# Clone a repository
git clone https://github.com/username/repo.git

# Fetch changes from remote
git fetch origin

# Pull changes and merge
git pull origin main

2. Staging a File

Definition:

Staging involves preparing changes in your working directory for commit.

Example:

# Stage all changes
git add .

# Commit the staged changes
git commit -m "Your commit message"

3. git init

Definition:

Initializes a new Git repository in your current directory.

Example:

# Create a new directory and initialize Git
mkdir new-repo
cd new-repo
git init

4. Listing All Branches

Definition:

Lists all local and remote branches in the repository.

Example:

# List all branches
git branch -a

5. Difference Between git merge and git rebase

Definition:

  • git merge: Combines two branches and creates a new commit.

  • git rebase: Moves or combines commits from one branch onto another without creating a new commit.

Example:

# Merge feature-branch into main
git checkout main
git merge feature-branch

# Rebase feature-branch onto main
git checkout feature-branch
git rebase main

6. Creating and Switching to a New Branch

Definition:

Creating a new branch allows you to work on separate features or fixes without affecting the main codebase.

Example:

# Create and switch to a new branch
git checkout -b new-branch

7. Merge Conflict

Definition:

A merge conflict occurs when two branches have changes in the same part of a file, and Git cannot automatically merge them.

Example:

  1. Both developers change the same line in a file.

  2. Attempt to merge the branches.

  3. Resolve the conflict manually in the affected file.

8. Deleting a Branch

Definition:

Removes a branch that is no longer needed.

Example:

# Delete a local branch
git branch -d branch-name

# Force delete a local branch
git branch -D branch-name

# Delete a remote branch
git push origin --delete branch-name

9. Checking Differences Between Branches

Definition:

Displays changes between two branches.

Example:

# Show differences between dev and qa branches
git diff dev qa

10. Forking a Repository

Definition:

Creating a personal copy of someone else's repository on GitHub.

Example:

  1. Click the "Fork" button on the repository page on GitHub.

  2. Clone your forked repository to your local machine.

11. Pull Request (PR)

Definition:

A request to merge changes from one branch into another, often requiring review.

Example:

  1. After pushing changes to a branch, navigate to GitHub.

  2. Click "New Pull Request" and follow the prompts.

12. Reviewing and Approving a PR

Definition:

The process of examining the changes proposed in a Pull Request.

Example:

  1. Open the PR on GitHub.

  2. Review the changes and click "Approve."

13. Adding Collaborators

Definition:

Inviting others to contribute to your repository.

Example:

  1. Go to your repository settings.

  2. Click "Manage access" and invite collaborators by their GitHub username or email.

14. Difference Between origin and upstream

Definition:

  • origin: Your personal clone of a repository.

  • upstream: The original repository from which your repo was forked.

Example:

# Set the upstream repository
git remote add upstream https://github.com/original/repo.git

15. Linking a Local Repository with a Remote

Definition:

Establishing a connection between your local repository and a remote one.

Example:

# Link to the remote repository
git remote add origin https://github.com/username/repo.git

16. Purpose of the .gitignore File

Definition:

Specifies files and directories that Git should ignore.

Example:

# .gitignore file contents
node_modules/
*.log

17. GitHub Actions

Definition:

Automation tool for CI/CD that allows you to create workflows for your projects.

Example:

  1. Create a .github/workflows directory.

  2. Add a YAML file defining your workflow.

18. Creating Issues in GitHub

Definition:

A feature for tracking tasks, bugs, or enhancements.

Example:

  1. Click the "New issue" button in the repository.

  2. Fill out the title and description, then submit.

19. GitHub Pages

Definition:

A service that hosts static websites directly from a GitHub repository.

Example:

  1. Push your HTML/CSS files to the gh-pages branch.

  2. Enable GitHub Pages in the repository settings.

20. GitHub Secrets

Definition:

Securely store sensitive information for use in GitHub Actions.

Example:

  1. Go to "Settings" > "Secrets" in your repository.

  2. Add secrets to use in your workflows.

21. Best Practices for PR Submission

Definition:

A set of guidelines to follow when contributing to a project.

Example:

  1. Read the issue carefully.

  2. Resolve the issue and create a PR.

  3. Wait for approval from the maintainers.

22. Importance of Regularly Pushing Changes

Definition:

Keeps the remote repository up to date and minimizes merge conflicts.

Example:

# Push changes to the remote repository
git push origin branch-name

23. Recovering from a Force Push

Definition:

Restoring a previous state after an unwanted force push.

Example:

  1. Use git reflog to find the previous commit.

  2. Reset to that commit using git reset --hard <commit-hash>.

24. Proposing Changes with a Branch

Definition:

Creating a separate branch for your changes before submitting a PR.

Example:

# Create a new branch for changes
git checkout -b new-feature
# Work on your changes, then create a PR

1. GitHub Pulse

GitHub Pulse gives an overview of repository activity, showing contributions over time. For example, if you're managing a project, you can use Pulse to see how many commits were made in the last week, helping you assess team productivity.

2. Git Codespace vs. git.dev

Git Codespace is a cloud-based development environment that allows you to code directly in your browser. git.dev is a simple, web-based editor for GitHub repositories. For instance, you might use Codespaces for complex projects requiring a full development environment, while git.dev is suitable for quick edits.

3. Git Projects

Git Projects help organize tasks and workflows. You can create a project board to track issues and pull requests, using Kanban-style cards. For example, a team might use Git Projects to visualize the progress of new feature development.

4. Git Projects vs. Classic Projects

While Git Projects (now known as "Projects") offer new features like a more flexible layout and integrations with GitHub Issues, Classic Projects rely on a fixed card layout. A development team might switch to the new Projects for better customization and automation.

5. Git Insights, Current Charts, and Historical Charts

Git Insights provide analytics on repository activity, helping teams understand trends over time. Current Charts display real-time data, while Historical Charts show changes over a longer period. For example, if a repository sees a spike in contributions during a sprint, insights can help analyze what drove that engagement.

6. Git vs. Git Pro vs. Git Teams vs. Git Enterprise

Git is the basic version control system. Git Pro includes additional features aimed at professionals. Git Teams is tailored for collaborative environments, while Git Enterprise focuses on large organizations needing advanced security and compliance features. A startup might start with Git, then move to Git Teams as they scale.

7. Git Individual vs. Git Business

Git Individual accounts are meant for personal projects, while Git Business accounts offer enhanced collaboration features, support, and security for teams. For instance, a freelancer might use an Individual account, while a company would benefit from a Business account for team collaboration.

8. GitHub Marketplace

The GitHub Marketplace is a platform for finding and purchasing tools that integrate with GitHub. For example, a developer could find CI/CD tools to streamline their deployment process directly through the Marketplace.

9. Git Repo Security

Git Repo Security encompasses practices to protect repositories, including branch protection rules, required reviews, and secret scanning. For example, enforcing a policy that requires two reviews before merging helps prevent unauthorized changes.

10. GitHub Flow

GitHub Flow is a lightweight workflow for managing changes in a repository. It encourages developers to create a branch for each feature or bug fix, then open a pull request for review. For example, a developer working on a new feature can branch off main, develop, and then request feedback via a pull request.

11. Inner Source vs. Open Source

Inner Source refers to using open-source practices within an organization, while Open Source is publicly available code. For instance, a company might develop its internal libraries using Inner Source to encourage collaboration while keeping the codebase proprietary.

Feel free to expand on these points or ask for more details on any specific topic!

Github Foundations Practice Test

1. How can a user highlight a post to the top of the Discussions page?

  • Options:
    A) Create an issue from the discussion
    B) Save the discussion
    C) Pin the discussion
    D) Star the discussion

  • Answer: C) Pin the discussion


  • Options:
    A) resolves
    B) join
    C) fix
    D) connects
    E) merge
    F) closed

  • Answer: A) resolves, C) fix, F) closed


3. What is the difference between Git and GitHub?

  • Options:
    A) Git is a cloud-based hosting service, while GitHub is a distributed version control system.
    B) Git is a centralized version control system, while GitHub is a cloud-based collaboration platform.
    C) Git is a command-line tool for tracking file changes, while GitHub is a platform for collaborating on Git repositories.
    D) Git and GitHub are different names for the same tool that is used for version control and collaboration.

  • Answer: C) Git is a command-line tool for tracking file changes, while GitHub is a platform for collaborating on Git repositories.


4. Which syntax is used for authoring saved replies?

  • Options:
    A) HTML
    B) YAML
    C) Markup
    D) Markdown

  • Answer: D) Markdown


5. As a repository admin, which alerts can you see from the security tab of a repository?

  • Options:
    A) Secret Scanning
    B) Code Scanning
    C) Push Protection Bypass
    D) Branch Protection
    E) Dependabot

  • Answer: A) Secret Scanning, B) Code Scanning, E) Dependabot


6. Which GitHub tools or features is best to quickly modify a batch of files in a repository?

  • Options:
    A) Create and use a new GitHub Codespace
    B) Install and use GitHub Desktop
    C) Use github.dev from a web browser
    D) Install and use the git CLI
    E) Install and use GitHub Mobile

  • Answer: A) Create and use a new GitHub Codespace, C) Use github.dev from a web browser


7. An employee needs to find all issues within organization "Avocado" containing text "404 error" and a "guacamole" label. Which of the following steps would be best to search for these results?

  • Options:
    A) Enter query org:Avocado label:guacamole 404 error in the search bar. Select "Issues" in the "Filter by" section.
    B) Enter query org:Avocado in:issues label:guacamole contains:404 error in the search bar.
    C) Go to "Avocado" organization. Select Issues under a repository, Filter issues with a "guacamole" label.
    D) Go to the "Avocado" organization settings. Select Repository defaults under Repository. Scroll to Repository labels and select the "guacamole" label.

  • Answer: A) Enter query org:Avocado label:guacamole 404 error in the search bar. Select "Issues" in the "Filter by" section.


8. Who can be assigned to an issue or pull request?

  • Options:
    A) anyone who has a personal GitHub account
    B) anyone who has commented on the issue or pull request
    C) anyone who has an enterprise GitHub account
    D) anyone with write permissions to the repository

  • Answer: A) anyone who has a personal GitHub account, D) anyone with write permissions to the repository


9. Which Insights feature allows users to view repository activity including: pull requests, issues, and commit history?

  • Options:
    A) Activity overview
    B) Code frequency
    C) Pulse
    D) Traffic

  • Answer: C) Pulse


10. What steps must you follow to use GitHub Copilot?

  • Options:
    A) Install the Copilot App on your GitHub organization, account, or server
    B) Install the Copilot extension for your supported IDE
    C) Store your coding project(s) in GitHub
    D) Sign and submit the legal disclaimer
    E) Sign up for a Copilot edition and enable it for your account

  • Answer: B) Install the Copilot extension for your supported IDE, E) Sign up for a Copilot edition and enable it for your account


11. The difference between GitHub Enterprise Server (GHES) and GitHub Enterprise Cloud is that GHES:

  • Options:
    A) cannot enable rate limiting.
    B) includes authentication with SAML single sign-on and access provisioning with SAML or SCIM.
    C) can be deployed on both Windows and Linux.
    D) is a self-hosted solution that allows organizations to have full control over their infrastructure.

  • Answer: D) is a self-hosted solution that allows organizations to have full control over their infrastructure.


12. While maintaining the gist history, which of the following is the most efficient way to create a public gist based on another user's gist?

  • Options:
    A) Clone the gist
    B) Create a new gist and copy the content from the existing gist
    C) Request to be added to the existing gist
    D) Fork the gist

  • Answer: D) Fork the gist


13. When creating a repository from a template, what will the new repository contain?

  • Options:
    A) commit history
    B) default branch
    C) contributors
    D) pull requests

  • Answer: B) default branch


14. Which of the following GitHub features supports Polling?

  • Options:
    A) Discussions
    B) Wikis
    C) Issues
    D) Projects

  • Answer: A) Discussions


15. What is the difference between an organization member and an outside collaborator?

  • Options:
    A) Two-factor authentication (2FA) is not required for outside collaborators.
    B) Organization base permissions do not apply to outside collaborators.
    C) Outside collaborators do not consume paid licenses.
    D) Outside collaborators cannot be given the admin role on a repository.

  • Answer: B) Organization base permissions do not apply to outside collaborators.


16. Workflows can reference actions in:

  • Options:
    A) GitHub Packages
    B) an enterprise marketplace
    C) a published Docker container image on Docker Hub
    D) the same repository as your workflow file
    E) any public repository

  • Answer: A) GitHub Packages, C) a published Docker container image on Docker Hub, E) any public repository


17. What are advantages of GitHub Projects over GitHub Projects Classic?

  • Options:
    A) GitHub Projects are Copilot enabled.
    B) GitHub Projects has Insights.
    C) GitHub Projects can be connected to third-party tools.
    D) GitHub Projects has multiple layout views.

  • Answer: B) GitHub Projects has Insights, D) GitHub Projects has multiple layout views


18. GitHub Copilot leverages an AI model trained using:

  • Options:
    A) public GitHub repositories
    B) public, internal, and private repositories in your GitHub organization
    C) public and internal repositories in your GitHub organization
    D) code samples from online forums

  • Answer: A) public GitHub repositories


19. What is a benefit of using GitHub Enterprise Cloud with Enterprise Managed Users (EMU)?

  • Options:
    A) It provides centralized control and streamlined management of user accounts through their identity provider (IdP).
    B) It enables GitHub user accounts access to protected resources using SAML SSO.
    C) It automatically validates user interactions using the identity provider (IdP) conditional access policy (CAP).
    D) It offers additional collaboration and content creation capabilities for managed user accounts.

  • Answer: A) It provides centralized control and streamlined management of user accounts through their identity provider (IdP).


20. Which of the following steps are part of the Codespaces lifecycle?

  • Options:
    A) Delete
    B) Create
    C) Rollback
    D) Clone
    E) Rebuild
    F) Commit
    G) Install

  • Answer: A) Delete, B) Create, E) Rebuild

  • Options:
    A) Ostarwatcher
    B) Ostargazers
    C) Ostars
    D) Ostarviewers

  • Answer: B) Ostargazers


22. As a user, what feature can you use to merge proposed changes in a repository on GitHub?

  • Options:
    A) Projects
    B) Discussions
    C) Pull requests
    D) Issues

  • Answer: C) Pull requests


23. An organization in a GitHub Enterprise has a base permission of "No permissions." Which users in this enterprise will be able to see all internal repositories within this organization?

  • Options:
    A) Outside collaborators in the same organization
    B) Members in the same organization
    C) Members in another organization in that enterprise
    D) Outside collaborators with repo Admin access

  • Answer: B) Members in the same organization, C) Members in another organization in that enterprise


24. Which of the following two-factor authentication (2FA) methods can you use to secure a GitHub account?

  • Options:
    A) Security questions
    B) Security keys
    C) Authenticator app
    D) GitHub mobile
    E) Single sign-on

  • Answer: B) Security keys, C) Authenticator app, D) GitHub mobile


25. Which of the following statements is true regarding the mergeability of draft pull requests?

  • Options:
    A) They cannot be merged, but code owners are automatically requested to review.
    B) They can be merged, but code owners are not automatically requested to review.
    C) They can be merged, and code owners are automatically requested to review.
    D) They cannot be merged, and code owners are not automatically requested to review.

  • Answer: D) They cannot be merged, and code owners are not automatically requested to review.


26. Which three files can a user automatically add while creating a new repository?

  • Options:
    A) README, .git, and DOCS
    B) LICENSE, DOCS, and .gitignore
    C) README, .gitignore, and LICENSE
    D) LICENSE, git, and README

  • Answer: C) README, .gitignore, and LICENSE


27. As a user, what feature can you use to add an issue to the top of the Issues page for easier visibility?

  • Options:
    A) Pin the issue
    B) Label the issue
    C) Subscribe to the issue
    D) Star the issue

  • Answer: A) Pin the issue


28. Which of the following permissions can be enabled or disabled at the enterprise level?

  • Options:
    A) Repository visibility change
    B) Repository deletion and transfer
    C) Repository secrets
    D) Repository naming convention

  • Answer: A) Repository visibility change, B) Repository deletion and transfer


29. Copilot for Individuals offers which of the following features that are not offered by Copilot for Business?

  • Options:
    A) Organization-wide policy management
    B) VPN proxy support via self-signed certificates
    C) Offers multi-line function suggestions
    D) Support for personal GitHub accounts
    E) Telemetry
    F) Blocks suggestions matching public code

  • Answer: C) Offers multi-line function suggestions, D) Support for personal GitHub accounts


30. What template types are available when creating an issue template?

  • Options:
    A) Security notification
    B) Standard template
    C) Feature request
    D) Bug report
    E) Custom template

  • Answer: C) Feature request, D) Bug report, E) Custom template


31. Which of the following attributes are on the Milestone page?

  • Options:
    A) GitHub Action workflows that need to be executed to complete the milestone
    B) A summary list of GitHub Projects tagged to the milestone
    C) A list of the open and closed issues associated with the milestone
    D) Each milestone's completion percentage

  • Answer: C) A list of the open and closed issues associated with the milestone, D) Each milestone's completion percentage


32. What command should you type to create and switch over to a new branch?

  • Options:
    A) git checkout - newBranchName
    B) git branch newbranchName
    C) git checkout newbranchName
    D) git checkout -b newbranchName

  • Answer: D) git checkout -b newbranchName


33. What is the primary goal of GitHub in terms of integrating tools and providing an ecosystem?

  • Options:
    A) To offer a diverse range of tools for specific development needs
    B) To develop proprietary tools and provide opinionated integration options
    C) To create a unified, standardized ecosystem for all developers
    D) To bring developers' preferred tools together in one place

  • Answer: D) To bring developers' preferred tools together in one place


34. What GitHub feature allows the developer community to financially support the people and organizations behind open source projects they depend on?

  • Options:
    A) GitHub Support
    B) GitHub Community Exchange
    C) GitHub Sponsors
    D) GitHub Discussions

  • Answer: C) GitHub Sponsors


35. For which of the following does GitHub provide hosted runners?

  • Options:
    A) Linux, Windows, and macOS
    B) Docker
    C) Kubernetes
    D) AWS, Azure, and GCP

  • Answer: A) Linux, Windows, and macOS


36. Which version control system is GitHub built on top of?

  • Options:
    A) Git
    B) Perforce
    C) Subversion
    D) Mercurial

  • Answer: A) Git


37. Which of the following outcomes can be achieved with a branch protection rule?

  • Options:
    A) Restrict who can view the branch
    B) Require approval before merging changes
    C) Block code pushes that contain hardcoded secrets
    D) Require two-factor authentication (2FA) by code contributors

  • Answer: B) Require approval before merging changes


  • Options:
    A) To automatically trigger GitHub Actions workflows
    B) To automatically label or assign newly created pull requests
    C) To easily coerce existing pull requests into a standard format
    D) To provide an easy-to-fill-out form for creating new pull requests

  • Answer: C) To easily coerce existing pull requests into a standard format, D) To provide an easy-to-fill-out form for creating new pull requests


39. What should a user follow to see public activity on their personal dashboard?

  • Options:
    A) Enterprises
    B) People
    C) Organizations
    D) Teams
    E) Stars

  • Answer: B) People, C) Organizations


40. What are achievements on a GitHub user profile?

  • Options:
    A) Virtual trophies awarded for completing coding challenges
    B) Total number of repositories owned
    C) Number of stars received on repositories
    D) Special recognition for significant contributions and milestones

  • Answer: D) Special recognition for significant contributions and milestones

41. Which of the following statements most accurately describes who can access a private repository Wiki?

  • Options:
    A) Wikis can be viewed by the same people who have Read access to the repository.
    B) Wikis will not be visible until shared with a specific user.
    C) Wikis are only viewable by repository admins.
    D) Wikis are public regardless of whether you have access to the repository.

  • Answer: A) Wikis can be viewed by the same people who have Read access to the repository.


42. Which mechanisms can you use to personalize Codespaces for your account?

  • Options:
    A) Operating system
    B) Dotfiles
    C) Settings sync
    D) Devcontainer
    E) Branch protections
    F) IDE plug-ins

  • Answer: B) Dotfiles, C) Settings sync


43. Which of the following statements most accurately describes secret gists?

  • Options:
    A) Secret gists require GitHub Enterprise.
    B) Users with assigned access can view the gist.
    C) Anyone can see the gist from the gist Discover page.
    D) Anyone with the URL for the gist can view the gist.

  • Answer: D) Anyone with the URL for the gist can view the gist.


44. What qualifier finds issues that mention a certain user?

  • Options:
    A) Mentions!
    B) Threads:
    C) Mentioned:
    D) @mentioned

  • Answer: C) Mentioned:


45. Which of the following features does GitHub provide to enhance collaboration within teams?

  • Options:
    A) Code review and discussion through issues and pull requests
    B) Real-time collaboration through pair programming
    C) Git repositories hosting and sharing capabilities
    D) Automated testing and code quality analysis

  • Answer: A) Code review and discussion through issues and pull requests


46. Which of the following default workflows are available as part of GitHub Projects?

  • Options:
    A) Label added to issue
    B) Pull request opened
    C) Auto-archive items
    D) Pull request merged
    E) Item closed

  • Answer: B) Pull request opened, C) Auto-archive items, E) Item closed


  • Options:
    A) Create a README file describing the repository
    B) Add topics to classify the repository
    C) Add labels to categorize the repository
    D) Register the repository with GitHub search

  • Answer: A) Create a README file describing the repository, B) Add topics to classify the repository


48. Which of the following is a key characteristic of GitHub Projects?

  • Options:
    A) Ability to visualize the commit history
    B) Ability to import Gantt charts from Microsoft Project
    C) Ability to enforce required fields
    D) Ability to create and customize multiple views

  • Answer: D) Ability to create and customize multiple views


49. Which of the following is the purpose of a GitHub repository?

  • Options:
    A) To provide a folder that stores project files, including documentation, on your local machine
    B) To provide a collaborative space where developers can share and manage code files, track changes, and store revision history
    C) To provide a cloud-based hosting service for project documentation, providing a secure and centralized location for file storage
    D) To provide a version control system designed for small projects, offering simple tools for organizing files on your laptop

  • Answer: B) To provide a collaborative space where developers can share and manage code files, track changes, and store revision history


50. New open-source contributors can receive funding from GitHub sponsors:

  • Options:
    A) After setting up a sponsored developer profile.
    B) Equal to 95% of the contribution value.
    C) Using PayPal as a payment processor.
    D) By including GitHub matching funds.

  • Answer: A) After setting up a sponsored developer profile.


51. What are all repository visibility options in GitHub Enterprise?

  • Options:
    A) External, public, and private
    B) Public, internal, and private
    C) External, private
    D) Public, private

  • Answer: B) Public, internal, and private


52. Which of the following best describes GitHub flow?

  • Options:
    A) A strategy where separate branches are created for each release, and pull requests are used to collaborate on and approve releases
    B) A branching model that uses feature branches and multiple primary branches
    C) A lightweight workflow that allows for safe experimentation with new ideas and collaboration on projects through branching, pull requests, and merging
    D) A strict workflow that enforces a linear development process with all changes made directly on the main branch

  • Answer: C) A lightweight workflow that allows for safe experimentation with new ideas and collaboration on projects through branching, pull requests, and merging


53. Why is branching a core concept in Git?

  • Options:
    A) Branching creates an isolated environment to try new ideas and make changes without affecting other branches.
    B) Branching helps in automatically merging changes from different branches into the main branch.
    C) Branching is necessary for organizing files and folders within a Git repository.
    D) Branching creates physical copies of the project on disk, ensuring data redundancy and backup.

  • Answer: A) Branching creates an isolated environment to try new ideas and make changes without affecting other branches.


54. Without using advanced search syntax, what are some of the available default filters when searching through issues?

  • Options:
    A) Your project
    B) Everything assigned to you
    C) Everything assigned to your team
    D) Everything you have commented on
    E) Your issues

  • Answer: B) Everything assigned to you, E) Your issues


55. Which of the following types of charts can a user create to get GitHub Projects insights?

  • Options:
    A) Historical charts
    B) Pie charts
    C) Forecast charts
    D) Current charts
    E) Gantt charts

  • Answer: A) Historical charts, D) Current charts


56. If there are multiple README files, which of the following locations will be displayed first?

  • Options:
    A) Root
    B) .github
    C) Docs
    D) Src

  • Answer: A) Root


57. Which of the following are counted in the contribution graph on a user's profile?

  • Options:
    A) Issues closed
    B) Public repositories
    C) Followers
    D) Pull requests created
    E) Commits made

  • Answer: D) Pull requests created, E) Commits made


  • Options:
    A) In the description of the issue
    B) In the comment section of the issue
    C) In the right sidebar of the pull request, under "Development"
    D) In the right sidebar of the pull request, under "Assignees"

  • Answer: C) In the right sidebar of the pull request, under "Development"


59. How is github.dev different than Codespaces?

  • Options:
    A) Codespaces is available within the web browser.
    B) Extensions in the Visual Studio Code Marketplace are supported by github.dev.
    C) A free monthly quota for personal accounts is provided by github.dev.
    D) Codespaces provides terminal access.

  • Answer: D) Codespaces provides terminal access.


60. What is a Git remote?

  • Options:
    A) A branch in the repository where changes are pushed for collaboration
    B) A separate repository for testing before pushing changes to the main repository
    C) A local copy of the repository stored on a user's machine
    D) A reference to a repository that is hosted in a separate location

  • Answer: D) A reference to a repository that is hosted in a separate location

61. Which of the following outcomes can be achieved with a branch protection rule?

  • Options:
    A) Restrict who can view the branch.
    B) Require approval before merging changes.
    C) Block code pushes that contain hardcoded secrets.
    D) Require two-factor authentication (2FA) by code contributors.

  • Answer: B) Require approval before merging changes.


  • Options:
    A) To automatically trigger GitHub Actions workflows.
    B) To automatically label or assign newly created pull requests.
    C) To easily coerce existing pull requests into a standard format.
    D) To provide an easy-to-fill-out form for creating new pull requests.

  • Answer: C) To easily coerce existing pull requests into a standard format, D) To provide an easy-to-fill-out form for creating new pull requests.


63. What should a user follow to see public activity on their personal dashboard?

  • Options:
    A) Enterprises
    B) People
    C) Organizations
    D) Teams
    E) Stars

  • Answer: B) People, C) Organizations.


64. What are achievements on a GitHub user profile?

  • Options:
    A) Virtual trophies awarded for completing coding challenges.
    B) Total number of repositories owned.
    C) Number of stars received on repositories.
    D) Special recognition for significant contributions and milestones.

  • Answer: D) Special recognition for significant contributions and milestones.


65. Which of the following permissions can be enabled or disabled at the enterprise level?

  • Options:
    A) Repository visibility change
    B) Repository deletion and transfer
    C) Repository secrets
    D) Repository naming convention

  • Answer: A) Repository visibility change, B) Repository deletion and transfer.


66. Which of the following features does GitHub provide to enhance collaboration within teams?

  • Options:
    A) Code review and discussion through issues and pull requests
    B) Real-time collaboration through pair programming
    C) Git repositories hosting and sharing capabilities
    D) Automated testing and code quality analysis

  • Answer: A) Code review and discussion through issues and pull requests.


67. What command should you type to create and switch over to a new branch?

  • Options:
    A) git checkout - newBranchName
    B) git branch newBranchName
    C) git checkout newBranchName
    D) git checkout -b newBranchName

  • Answer: D) git checkout -b newBranchName.


68. What are some ways of improving the discoverability of a repository?

  • Options:
    A) Add a detailed README.
    B) Add stars to the repository.
    C) Use topics and descriptions to classify the repository.
    D) Register the repository with GitHub Enterprise.

  • Answer: A) Add a detailed README, C) Use topics and descriptions to classify the repository.


69. Which types of files can a user automatically add while creating a new repository?

  • Options:
    A) README, .git, and DOCS
    B) LICENSE, DOCS, and .gitignore
    C) README, .gitignore, and LICENSE
    D) LICENSE, .git, and README

  • Answer: C) README, .gitignore, and LICENSE.


70. Which version control system is GitHub built on top of?

  • Options:
    A) Git
    B) Perforce
    C) Subversion
    D) Mercurial

  • Answer: A) Git.


71. Which of the following describes a GitHub pull request?

  • Options:
    A) A request for feedback on a code change that is ready to be merged.
    B) A request to remove a repository.
    C) A request to create a new issue.
    D) A request to modify the repository's visibility.

  • Answer: A) A request for feedback on a code change that is ready to be merged.


72. Which of the following features allows users to pin important issues to the top of the Issues page for easier visibility?

  • Options:
    A) Label the issue.
    B) Pin the issue.
    C) Subscribe to the issue.
    D) Star the issue.

  • Answer: B) Pin the issue.


73. What are achievements on a GitHub user profile?

  • Options:
    A) Virtual trophies awarded for completing coding challenges.
    B) Special recognition for significant contributions and milestones.
    C) The number of repositories a user owns.
    D) The number of stars received on repositories.

  • Answer: B) Special recognition for significant contributions and milestones.


74. Which of the following outcomes can be achieved with a branch protection rule?

  • Options:
    A) Restrict who can view the branch.
    B) Require approval before merging changes.
    C) Block code pushes that contain hardcoded secrets.
    D) Require two-factor authentication (2FA) by code contributors.

  • Answer: B) Require approval before merging changes.


75. Which types of files can a user automatically add while creating a new repository?

  • Options:
    A) README, .git, and DOCS
    B) LICENSE, DOCS, and .gitignore
    C) README, .gitignore, and LICENSE
    D) LICENSE, .git, and README

  • Answer: C) README, .gitignore, and LICENSE.


76. What GitHub feature allows the developer community to financially support the people and organizations behind open-source projects they depend on?

  • Options:
    A) GitHub Support
    B) GitHub Community Exchange
    C) GitHub Sponsors
    D) GitHub Discussions

  • Answer: C) GitHub Sponsors.


77. Which GitHub feature provides hosted runners?

  • Options:
    A) Linux, Windows, and macOS
    B) Docker
    C) Kubernetes
    D) AWS, Azure, and GCP

  • Answer: A) Linux, Windows, and macOS.


78. What is the purpose of a GitHub repository?

  • Options:
    A) To provide a folder that stores project files, including documentation, on your local machine.
    B) To provide a collaborative space where developers can share and manage code files, track changes, and store revision history.
    C) To provide a cloud-based hosting service for project documentation, providing a secure and centralized location for file storage.
    D) To provide a version control system designed for small projects, offering simple tools for organizing files on your laptop.

  • Answer: B) To provide a collaborative space where developers can share and manage code files, track changes, and store revision history.


79. Which of the following statements is true regarding the mergeability of draft pull requests?

  • Options:
    A) They cannot be merged, but code owners are automatically requested to review.
    B) They can be merged, but code owners are not automatically requested to review.
    C) They can be merged, and code owners are automatically requested to review.
    D) They cannot be merged, and code owners are not automatically requested to review.

  • Answer: D) They cannot be merged, and code owners are not automatically requested to review.


80. Which of the following filters are available when searching through issues without using advanced search syntax?

  • Options:
    A) Your project
    B) Everything assigned to you
    C) Everything assigned to your team
    D) Everything you have commented on
    E) Your issues

  • Answer: B) Everything assigned to you, E) Your issues.

81. Which of the following types of charts can a user create to get GitHub Projects insights?

  • Options:
    A) Historical charts
    B) Pie charts
    C) Forecast charts
    D) Current charts
    E) Gantt charts

  • Answer: B) Pie charts, D) Current charts.


82. If there are multiple README files, which of the following locations will be displayed first?

  • Options:
    A) Root
    B) .github
    C) Docs
    D) Src

  • Answer: A) Root.


83. Which of the following are counted in the contribution graph on a user's profile?

  • Options:
    A) Issues closed
    B) Public repositories
    C) Followers
    D) Pull requests created
    E) Commits made

  • Answer: D) Pull requests created, E) Commits made.


  • Options:
    A) In the description of the issue
    B) In the comment section of the issue
    C) In the right sidebar of the pull request, under "Development"
    D) In the right sidebar of the pull request, under "Assignees"

  • Answer: C) In the right sidebar of the pull request, under "Development."


85. How is github.dev different from Codespaces?

  • Options:
    A) Codespaces is available within the web browser.
    B) Extensions in the Visual Studio Code Marketplace are supported by github.dev.
    C) A free monthly quota for personal accounts is provided by github.dev.
    D) Codespaces provides terminal access.

  • Answer: D) Codespaces provides terminal access.


86. What is a Git remote?

  • Options:
    A) A branch in the repository where changes are pushed for collaboration
    B) A separate repository for testing before pushing changes to the main repository
    C) A local copy of the repository stored on a user's machine
    D) A reference to a repository that is hosted in a separate location

  • Answer: D) A reference to a repository that is hosted in a separate location.


87. Which mechanisms can you use to personalize Codespaces for your account?

  • Options:
    A) Operating system
    B) Dotfiles
    C) Settings sync
    D) Devcontainer
    E) Branch protections
    F) IDE plug-ins

  • Answer: B) Dotfiles, C) Settings sync.


88. Which of the following statements most accurately describes secret gists?

  • Options:
    A) Secret gists require GitHub Enterprise.
    B) Users with assigned access can view the gist.
    C) Anyone can see the gist from the gist Discover page.
    D) Anyone with the URL for the gist can view the gist.

  • Answer: D) Anyone with the URL for the gist can view the gist.


89. What qualifier finds issues that mention a certain user?

  • Options:
    A) Mentions!
    B) Threads:
    C) Mentioned:
    D) @mentioned

  • Answer: C) Mentioned:.


90. Which version control system is GitHub built on top of?

  • Options:
    A) Git
    B) Perforce
    C) Subversion
    D) Mercurial

  • Answer: A) Git.


91. What is the primary goal of GitHub in terms of integrating tools and providing an ecosystem?

  • Options:
    A) To offer a diverse range of tools for specific development needs
    B) To develop proprietary tools and provide opinionated integration options
    C) To create a unified, standardized ecosystem for all developers
    D) To bring developers' preferred tools together in one place

  • Answer: D) To bring developers' preferred tools together in one place.


92. Which of the following describes a GitHub pull request?

  • Options:
    A) A request for feedback on a code change that is ready to be merged.
    B) A request to remove a repository.
    C) A request to create a new issue.
    D) A request to modify the repository's visibility.

  • Answer: A) A request for feedback on a code change that is ready to be merged.


93. Which types of files can a user automatically add while creating a new repository?

  • Options:
    A) README, .git, and DOCS
    B) LICENSE, DOCS, and .gitignore
    C) README, .gitignore, and LICENSE
    D) LICENSE, .git, and README

  • Answer: C) README, .gitignore, and LICENSE.


94. What GitHub feature allows the developer community to financially support the people and organizations behind open-source projects they depend on?

  • Options:
    A) GitHub Support
    B) GitHub Community Exchange
    C) GitHub Sponsors
    D) GitHub Discussions

  • Answer: C) GitHub Sponsors.


95. Which GitHub feature provides hosted runners?

  • Options:
    A) Linux, Windows, and macOS
    B) Docker
    C) Kubernetes
    D) AWS, Azure, and GCP

  • Answer: A) Linux, Windows, and macOS.


96. Which of the following best describes GitHub flow?

  • Options:
    A) A strategy where separate branches are created for each release, and pull requests are used to collaborate on and approve releases.
    B) A branching model that uses feature branches and multiple primary branches.
    C) A lightweight workflow that allows for safe experimentation with new ideas and collaboration on projects through branching, pull requests, and merging.
    D) A strict workflow that enforces a linear development process with all changes made directly on the main branch.

  • Answer: C) A lightweight workflow that allows for safe experimentation with new ideas and collaboration on projects through branching, pull requests, and merging.


97. What is the purpose of a GitHub repository?

  • Options:
    A) To provide a folder that stores project files, including documentation, on your local machine.
    B) To provide a collaborative space where developers can share and manage code files, track changes, and store revision history.
    C) To provide a cloud-based hosting service for project documentation, providing a secure and centralized location for file storage.
    D) To provide a version control system designed for small projects, offering simple tools for organizing files on your laptop.

  • Answer: B) To provide a collaborative space where developers can share and manage code files, track changes, and store revision history.


98. Why is branching a core concept in Git?

  • Options:
    A) Branching creates an isolated environment to try new ideas and make changes without affecting other branches.
    B) Branching helps in automatically merging changes from different branches into the main branch.
    C) Branching is necessary for organizing files and folders within a Git repository.
    D) Branching creates physical copies of the project on disk, ensuring data redundancy and backup.

  • Answer: A) Branching creates an isolated environment to try new ideas and make changes without affecting other branches.


99. Which of the following is a key characteristic of GitHub Projects?

  • Options:
    A) Ability to visualize the commit history.
    B) Ability to import Gantt charts from Microsoft Project.
    C) Ability to enforce required fields.
    D) Ability to create and customize multiple views.

  • Answer: D) Ability to create and customize multiple views.


100. New open-source contributors can receive funding from GitHub Sponsors:

  • Options:
    A) After setting up a sponsored developer profile.
    B) Equal to 95% of the contribution value.
    C) Using PayPal as a payment processor.
    D) By including GitHub matching funds.

  • Answer: A) After setting up a sponsored developer profile.

0
Subscribe to my newsletter

Read articles from Muhammad Hassan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Muhammad Hassan
Muhammad Hassan

Hey there! I'm currently working as an Associate DevOps Engineer, and I'm diving into popular DevOps tools like Azure Devops,Linux, Docker, Kubernetes,Terraform and Ansible. I'm also on the learning track with AWS certifications to amp up my cloud game. If you're into tech collaborations and exploring new horizons, let's connect!