nerdexam
Microsoft

GH-900 · Question #47

How are commits related to pull requests?

The correct answer is A. Commits are made on a branch that can have a linked pull request. Commits are made on a branch, and that branch can have a linked pull request associated with it (A). This is the correct relationship: you commit to a branch, then open a pull request to propose merging those commits into another branch. Commits are not restricted to only…

Collaboration Features

Question

How are commits related to pull requests?

Options

  • ACommits are made on a branch that can have a linked pull request.
  • BCommits can only be made after a pull request is created.
  • CCommits can only be made before a pull request is created.
  • DCommits are made on a pull request that can have a linked branch.

How the community answered

(18 responses)
  • A
    94% (17)
  • D
    6% (1)

Explanation

Commits are made on a branch, and that branch can have a linked pull request associated with it (A). This is the correct relationship: you commit to a branch, then open a pull request to propose merging those commits into another branch. Commits are not restricted to only before or after a pull request is created (B, C) - you can push additional commits to a branch while a pull request is already open. A pull request does not 'have' a linked commit in the ownership direction described in (D).

Topics

#Commits#Branches#Pull Requests#GitHub Workflow

Community Discussion

No community discussion yet for this question.

Full GH-900 Practice