The Pull Request

What this is. A pull request is a proposal: here is a branch, here is what it changes, please review it before it becomes part of main.

It is a GitHub feature rather than a git one, but it is the center of how nearly every team works, including teams of one.

The cycle, which you will repeat for years.

`

git switch -c fix-navigation

... work, commit

git push -u origin fix-navigation

open a pull request on GitHub

discussion and review

merge

git switch main

git pull

`

That last git pull matters and people forget it. After a merge on GitHub, your local main is behind until you bring the change down.

✦ Open a pull request even when you work alone

It seems ceremonial with nobody to review it, and it is still worth doing. It gives you a page showing every change together, a place to write why you made them, and a permanent record linked to the discussion. Reviewing your own pull request before merging catches an embarrassing number of mistakes, because reading a full diff feels different from writing it.

A pull request description should answer three things. What does this change, why was it needed, and how did you verify it works. A screenshot for anything visual. Those three answers turn a diff into a decision somebody can evaluate.

SANKOFA SANDBOX
learner:~$

Pull requests happen on the GitHub website. What you practice here is the branch and push half, which is the part that happens in the terminal.

Try it → Init, commit, add a remote. Then `git switch -c fix-heading`, change index.html, commit, and push. That is exactly the state from which you would open a pull request.

Mark this lesson complete

Signed in, your progress follows you to every device.

Next: Issues, Reviews, and the Flow →
← Back