Skip to content

Latest commit

 

History

History
670 lines (437 loc) · 26.4 KB

File metadata and controls

670 lines (437 loc) · 26.4 KB

GitHub Foundations exam logo

Topics

  1. Introduction to Git and GitHub
  2. Working with GitHub Repositories
  3. Collaboration Features
  4. Modern Development
  5. Project Management
  6. Privacy, Security, and Administration
  7. Benefits of the GitHub Community

1. Introduction to Git and GitHub

Question 1: What is the difference between Git and GitHub?

Options:

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

Answer: A

Question 2: What is a Git remote?

Options:

  • A. A separate repository for testing before pushing changes to the main repository.
  • B. A branch in the repository where changes are pushed for collaboration.
  • 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

Question 3: What is the purpose of GitHub Sponsors?

Options:

  • A. To financially support the people and organizations who maintain open-source projects.
  • B. To promote GitHub repositories in the marketplace.
  • C. To match contributions through GitHub's funding program.
  • D. To create a reward system for contributors based on stars.

Answer: A


2. Working with GitHub Repositories

Question 1: What is the purpose of a GitHub repository?

Options:

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

Answer: D

Question 2: Which of the following is the most efficient way to create a public gist based on another user's gist?

Options:

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

Answer: D


3. Collaboration Features

Question 1: Who can be assigned to an issue or pull request?

Options:

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

Answer: D

Question 2: Why are GitHub pull request templates recommended for use?

Options:

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

Answer: A, B


4. Modern Development

Question 1: What steps must you follow to use GitHub Copilot?

Options:

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

Answer: C, E

Question 2: What is the primary goal of GitHub in terms of integrating tools and providing an ecosystem?

Options:

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

Answer: D


5. Project Management

Question 1: What are advantages of GitHub Projects over GitHub Projects Classic?

Options:

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

Answer: A, B

Question 2: Which default workflows are available as part of GitHub Projects?

Options:

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

Answer: A, C, E


6. Privacy, Security, and Administration

Question 1: 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, B

Question 2: What is a restriction for Enterprise Managed Users (EMUs)?

Options:

  • A. Organization base permissions cannot be applied.
  • B. Users cannot create public repositories.
  • C. Each GitHub team must be linked to an identity provider group.
  • D. Custom repository roles are not available.

Answer: B


7. Benefits of the GitHub Community

Question 1: What are achievements on a GitHub user profile?

Options:

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

Answer: C

Question 2: What is the primary benefit of contributing to open source projects on GitHub?

Options:

  • A. Free hosting for all repositories.
  • B. Building a professional portfolio and learning from others.
  • C. Receiving financial support through GitHub Sponsors.
  • D. Access to premium features on GitHub.

Answer: B


Practice more: link


my Exam: 2024 Dec ( two times 75 + 75 )


1. Which of the following keywords are used to link a pull request to an issue?

Answer: fix, resolves, closed

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

Answer: code review and discussion through issues and pull requests

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

Answer: anyone who has commented on the issue or pull request, anyone with write permissions to the repository

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

Answer: Bug report, Feature request, Custom template

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

Answer: Create, Delete, Rebuild

6. Which of the following default workflows are available as part of GitHub projects?

Answer: "Pull request opened," "Auto-archive items," "Pull request merged"

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

Answer: Anyone with the URL for the gist can view the gist.

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

Answer: git checkout -b newBranchName

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

Answer: Linux, Windows, and macOS

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

Answer: a list of the open and closed issues associated with the milestone, each milestone's completion percentage

11. What type of operations has Git been optimized for?

Answer: local file manipulation and offline work

12. Which of the following is the best description of a Git commit?

Answer: a snapshot of the entire repository at a specific point in time, capturing the state of all files in the project

13. 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?

Answer: Fork the gist

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

Answer: historical charts, current charts

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

Answer: mentions:

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

Answer: default branch

17. Why is branching a core concept in Git?

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

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

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

19. What folder is the definition files stored in when creating custom issue forms?

Answer: .github/ISSUE_TEMPLATE

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

Answer: Pin the issue

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

Answer: Require approval before merging changes

22. What are two recommended ways of improving the discoverability of a repository?

Answer: Add topics to classify the repository, Create a README file describing the repository

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

Answer: Git

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

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

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

Answer: everything assigned to you, everything you have commented on

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

Answer: GitHub Sponsors

27. Which of the following is a restriction for Enterprise Managed Users (EMUS)?

Answer: Users cannot create public repositories.

28. Workflows can reference actions in:

Answer: the same repository as your workflow file, any public repository, GitHub Packages

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

Answer: Pin the discussion

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

Answer: pull requests created, commits made

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

Answer: README, .gitignore, and LICENSE

32. Which syntax is used for authoring saved replies?

Answer: Markdown

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

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

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

Answer: after setting up a sponsored developer profile

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

Answer: support for personal GitHub accounts, offers multi-line function suggestions

36. How is github.dev different than Codespaces?

Answer: Codespaces provides terminal access.

37. How can a user resume an existing Codespace that is bound to a repository?

Answer: Browse to the repository in GitHub.com and press the period "." key, Open https://github.com/codespaces in the browser, select the repository, and then select the existing Codespace

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

Answer: settings sync, dotfiles

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

Answer: to bring developers' preferred tools together in one place

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

Answer: root

41. Which Discussion category allows a user to mark a response as an answer?

Answer: Q&A

42. Why are GitHub pull request templates recommended for use?

Answer: to provide an easy-to-fill-out form for creating new pull requests, to automatically label or assign newly created pull requests

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

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

44. In GitHub flow, what is the primary operation when a pull request is approved?

Answer: The feature branch is merged

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

Answer: ability to create and customize multiple views

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

Answer: authenticator app, security keys, GitHub mobile

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

Answer: Use github.dev from a web browser

48. GitHub Copilot leverages an AI model trained using:

Answer: public GitHub repositories

49. What is the difference between Git and GitHub?

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

50. 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?

Answer: Enter query org:Avocado is:issue label:guacamole "404 error" in the search bar

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

Answer: public, internal, and private

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

Answer: repository visibility change, repository deletion and transfer

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

Answer: GitHub Projects has multiple layout views, GitHub Projects has Insights

54. Pull requests can only be created between two branches that are:

Answer: different

55. What is defined as software that can be freely used, modified, and shared by anyone?

Answer: open source

56. When making comments in GitHub, the supported text language is:

Answer: Markdown

57. Which of the following are characteristics of GitHub Teams?

Answer: Team visibility can be visible or secret, Teams can be nested

58. What is a Git remote?

Answer: a reference to a repository that is hosted in a separate location

59. 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?

Answer: members in the same organization, members in another organization in that enterprise

60. Where can a user manually link a pull request to an issue?

Answer: in the right sidebar of the pull request, under "Development"

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

Answer: Secret Scanning, Code Scanning, Dependabot

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

Answer: Organization base permissions do not apply to outside collaborators

63. Which of the following are components of GitHub Actions?

Answer: CI/CD, jobs, steps

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

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

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

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

66. How are issues and pull requests used?

Answer: Issues are used to track ideas, document feedback, and share information; whereas, pull requests are used to collaborate around proposed changes made to a branch

67. What are achievements on a GitHub user profile?

Answer: special recognition for significant contributions and milestones

68. What are GitHub Dependabot alerts used for?

Answer: to notify about vulnerabilities in dependencies

69. How can you set up a branch protection rule?

Answer: Through the repository settings in the Branches section

70. What is the purpose of using Git tags?

Answer: To mark specific points in history as important

71. What are GitHub Codespaces?

Answer: Cloud-hosted development environments

72. What is GitHub Actions?

Answer: A CI/CD tool to automate workflows

73. How can you make a repository public?

Answer: Change its visibility in the repository settings

74. What is the primary benefit of using GitHub Projects?

Answer: Organizing and tracking project tasks

75. How can you mention someone in an issue or pull request?

Answer: By using the "@" symbol followed by their username

76. What are milestones in GitHub?

Answer: Groups of issues or pull requests

77. How do you close an issue with a commit?

Answer: Include keywords like "fixes #issue_number" in the commit message

78. What is a GitHub fork?

Answer: A copy of a repository under your account

79. How can you contribute to an open-source project?

Answer: By submitting a pull request to the project

80. What is GitHub Sponsors?

Answer: A way to fund developers or projects

81. What is GitHub Pages?

Answer: A feature for hosting websites directly from a repository

82. How can you invite collaborators to a private repository?

Answer: Through the repository settings under "Manage Access"

83. What is the purpose of GitHub Discussions?

Answer: To enable community conversations around projects

84. What is the difference between a commit and a pull request?

Answer: A commit records changes locally, while a pull request proposes changes for merging

85. How do you enable GitHub Pages?

Answer: Through the repository settings under "Pages"

86. What is GitHub CLI?

Answer: A command-line interface for GitHub

87. What is the use of labels in GitHub?

Answer: To categorize issues and pull requests

88. How can you view your contribution graph on GitHub?

Answer: By visiting your GitHub profile

89. What are GitHub Actions Secrets?

Answer: Encrypted environment variables

90. How can you revert a commit?

Answer: By using the git revert command

91. What is the purpose of the .gitignore file?

Answer: To specify files and directories to be ignored by Git

92. How do you create a new branch in Git?

Answer: Use the command git branch branch_name

93. What does the git fetch command do?

Answer: Downloads changes from the remote repository without merging them

94. What is the difference between git pull and git fetch?

Answer: git pull fetches and merges changes, while git fetch only downloads changes

95. What is a merge conflict in Git?

Answer: It occurs when changes from different branches conflict during a merge

96. How do you resolve a merge conflict?

Answer: Manually edit the conflicting files, then commit the resolved changes

97. What is the purpose of git stash?

Answer: To temporarily save changes without committing them

98. How do you apply changes from the stash?

Answer: Use git stash apply or git stash pop

99. What is the difference between git reset and git revert?

Answer: git reset undoes commits in history, while git revert creates a new commit to undo changes

100. What does the git clone command do?

Answer: Creates a copy of a repository on your local machine

101. What is the purpose of a pull request template?

Answer: To standardize information in pull requests

102. What is the default branch in GitHub repositories?

Answer: Main (previously Master)

103. What is the purpose of GitHub Insights?

Answer: To provide analytics for repositories

104. How can you assign an issue to someone?

Answer: Use the "Assignees" section in the issue sidebar

105. What is the purpose of branch protection rules?

Answer: To enforce standards like required reviews before merging

106. How can you create a repository on GitHub?

Answer: Click on the "New" button in the Repositories tab

107. What is the purpose of GitHub Notifications?

Answer: To track activity and updates on repositories

108. How do you archive a repository?

Answer: Through the repository settings

109. What are GitHub Workflows?

Answer: Automated processes created with GitHub Actions

110. What is a Git submodule?

Answer: A repository embedded within another repository

111. What is the use of SSH keys in GitHub?

Answer: To authenticate securely with GitHub

112. What is the purpose of a GitHub Gist?

Answer: To share code snippets or small projects

113. How can you undo the last commit in Git?

Answer: Use the command git reset HEAD~

114. What is GitHub Marketplace?

Answer: A platform to find tools and integrations for GitHub

115. What does the git log command do?

Answer: Shows the commit history

116. How can you set up a webhook in GitHub?

Answer: Through the repository settings under "Webhooks"

117. What is the purpose of draft pull requests?

Answer: To start a conversation and seek feedback before finalizing changes

118. What is the purpose of git cherry-pick?

Answer: To apply specific commits from one branch to another

119. What does the git status command show?

Answer: The current state of the working directory and staging area

120. How do you rename a branch in Git?

Answer: Use the command git branch -m old_name new_name

121. What does the git blame command do?

Answer: Shows who made changes to each line of a file

122. What is the purpose of GitHub Discussions?

Answer: To facilitate community-driven conversations around a repository

123. How do you delete a branch in Git?

Answer: Use the command git branch -d branch_name

124. What is a fork in GitHub?

Answer: A personal copy of someone else’s repository

125. How can you submit a pull request in GitHub?

Answer: Click "New pull request" in the repository

126. What does git checkout do?

Answer: Switches to a different branch or commit

127. How can you contribute to an open-source project on GitHub?

Answer: Fork the repository, make changes, and create a pull request

128. What is the purpose of a .gitattributes file?

Answer: To configure attributes for files in a repository

129. What is a GitHub Code of Conduct?

Answer: A set of guidelines for participating in a repository

130. What is GitHub Sponsors?

Answer: A feature that allows financial support for developers and projects

131. What does git config do?

Answer: Configures Git settings like username and email

132. What is the purpose of Git tags?

Answer: To mark specific commits, such as for releases

133. What is a GitHub milestone?

Answer: A way to group issues and pull requests for a project goal

134. How can you delete a file from a repository?

Answer: Delete the file locally, commit, and push the changes

135. What is the purpose of git archive?

Answer: To create a compressed archive of a repository

136. What is the use of the CODEOWNERS file?

Answer: To specify who is automatically requested for code reviews

137. What is a GitHub Webhook?

Answer: A way to send real-time updates from GitHub to another service

138. How do you initialize a Git repository?

Answer: Use the command git init

139. What is the difference between git add and git commit?

Answer: git add stages changes, and git commit saves them in the history

140. What is the purpose of GitHub Pages?

Answer: To host websites directly from a GitHub repository

141. How can you check the differences between two commits?

Answer: Use git diff commit1 commit2

142. What is a GitHub release?

Answer: A packaged version of code for distribution

143. How can you rename a file in Git?

Answer: Use the command git mv old_name new_name

144. What is the purpose of git rebase?

Answer: To integrate changes by moving a branch onto another

145. What is GitHub's default license for repositories?

Answer: No license unless explicitly added

146. What is the purpose of .github folder in a repository?

Answer: To store community health files like issue templates

147. How do you undo changes in the working directory?

Answer: Use the command git checkout -- file_name

148. What is the purpose of git clean?

Answer: To remove untracked files from the working directory

149. What does the git push command do?

Answer: Uploads local changes to a remote repository

150. What does the git pull command do?

Answer: Fetches and merges changes from a remote repository