Pull Requests
100%

Git · Lesson 7

Pull Requests

Learn to read a pull request and identify what a review or automated check actually covers.

A pull request, often shortened to PR, proposes that changes from one branch enter another branch. Git tracks commits and branches. A hosting service adds the review page, discussion, and checks around those changes.

Reading the Source and Target

Suppose a teammate proposes a status page for the site. The review page shows health-page → main. The source, sometimes called the head, supplies the proposed work. The target, sometimes called the base, is the branch that would receive it.

Source: health-page at 3ab4501
Target: main
Changed file: health.txt

At this stage the review page describes a proposed change. The target branch receives the change when the PR is merged.

Which branch receives the health page when this PR is merged?

Checking the Diff

Open the changed-files view and read the diff relative to the PR's target. A one-line addition to health.txt is consistent with a small health page. If the review also shows a change to index.html, check whether that change belongs in the same proposal. Review the files the PR actually lists.

A PR titled Add a health page also edits the homepage. Where do you verify the exact edit?

Reading Automated Checks

A hosting service can run a test when a PR changes. Look for the commit or revision the result covers. If another commit is pushed after a passing run, verify that the updated revision has the required checks. A passing result says the checks that actually ran passed.

A test passed for 3ab4501. The PR now points to 78ac900. What should you check before relying on the result?

Lesson complete

You finished Pull Requests

You can now read what a pull request proposes and what evidence supports merging it.

  • Find the source and target branches.

  • Verify the proposed edits in the changed-files view.

  • Check which revision the automated result covers.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Git