🎓 A1Learner
🔍
0 of 50 lessons completed

Open a Pull Request

A pull request asks someone to take your branch into theirs. It is how work is reviewed on GitHub.

Push the branch

The branch arrives on the remote, ready to propose.

$ git push -u origin add-jam

The same join, done locally

In this course, the join happens here instead, with a merge. On GitHub, the pull request does this step after review.

$ git switch main
$ git merge add-jam

Example

$ git push -u origin add-jam

Key points

  • Work on a branch first. The branch holds one idea.
  • Push the branch to the remote, with -u the first time.
  • GitHub then offers a button to open a pull request.
  • A pull request names the branch and the branch it should join.
  • Reviewers read the changes and leave notes.
  • The merge happens on GitHub, after the review.
  • A fork is your own copy of someone else’s repository. Pull requests from forks are how open source grows.

Here, the branch arrives on the remote. On GitHub, the site offers a button to open a pull request for it. The review and the merge happen on the website, not in the terminal.

Try it Yourself

Edit the code, then press Run.

Running is simulated

Exercise

Where does a pull request happen?