GITHUB-FOUNDATIONS practice question 8 of 15
How are commits related to pull requests?
Full set: 75 questionsOn GitHub, commits are always recorded on a branch in a repository. A pull request (PR) is merely a comparison view that proposes merging one branch into another; it references whatever commits exist on the source branch. You may create a PR at any time after the first commit on a branch, and any subsequent commits pushed to that same branch are automatically added to the open PR. Therefore the relationship is: commits belong to a branch, and a pull request can be linked to that branch to aggregate those commits.
B. Commits can precede or follow PR creation; they are not restricted to after a PR exists.
C. Additional commits can be added while a PR is open, so they are not limited to before PR creation.
D. Commits are created on branches; a PR is not an entity that directly hosts commits.
1. GitHub Docs – “About pull requests”, §“Commits in a pull request” (docs.github.com/en/pull-requests/collaborating-with-issues-and-pull-requests/about-pull-requests)
2. GitHub Docs – “About branches”, ¶2-3 (docs.github.com/en/get-started/quickstart/github-flow#making-a-branch)
3. GitHub Docs – “GitHub Flow”, Step 4 “Open a Pull Request” (docs.github.com/en/get-started/quickstart/github-flow#open-a-pull-request)
Keep practicing
Take the free GITHUB-FOUNDATIONS practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GITHUB-FOUNDATIONS practice questions
- Question 1What are the defining features of Git?
- Question 2Which of the following two-factor authentication (2FA) methods can you use to secure a Gi…
- Question 3Which of the following are advantages of saved replies? (Each correct answer presents par…
- Question 4Which of the following can be performed within GitHub Desktop?
- Question 5Which of the following best describes cloning a repository?
- Question 6What should be done to locate an existing action that was provided by a GitHub-approved v…
