APull requesta proposal to merge one branch into another
BReviewcomment, suggest, approve
CMerge, squash, rebasethe three merge buttons
Pull requests
Last updated
Carla typed up Lola Remy's kare-kare and wants it in Kusina. Instead of pushing to main, she pushed a branch and opened a pull request: a page on the host where the family can read the change, discuss it, and merge it when it's right. In this lesson you'll review and merge hers, then open your own.
By the end of this lesson you can
Explain pull requests as a hosting feature built on branches
Open a pull request from a pushed branch, with a description that helps a reviewer
Review a pull request: read the changes, comment, approve
Say what each of the three merge buttons does to the graph
1
A proposal, not a command
A pull request (GitLab says merge request) is a page on the hosting site that says: "please merge my branch into main". It isn't part of Git; it's built on Git's branches:
Carla makes a branch, commits, and pushes the branch.
On the host, she opens a pull request from her branch into main, with a title and a description.
Others read the changes, comment, and approve or ask for changes. Carla pushes more commits to the same branch to answer; the pull request updates by itself.
Someone presses Merge. The host merges the branch into main, on the host. Everyone pulls.
A good description says what changed, why, and anything a reviewer should check: "Typed up from page 14 of Lola's notebook. Lola says ground peanuts, not peanut butter."
Here is a real pull request on GitHub. Its author found mistakes in a tutorial, reported them in an issue, then fixed them:
Title and number. What the pull request does, and its number. Pull requests and issues share one sequence of numbers.
State.Open until it’s merged or closed.
From which branch, into which. “wants to merge 1 commit into firstcontributions:main from Thien0912:fix/…”: the branch, here on the author’s fork, and where it should go.
Tabs. The conversation, the commits, automated checks, and Files changed: the diff (lesson 5.3).
Description. What was wrong and what changed. “Fixes #129159” links the issue it solves, and will close it when merged (lesson 5.6).
Reviewers and more. Who has been asked to review, and labels, projects and milestones.
Development. The issue this pull request will close when it’s merged.
A pull request on GitHub. Screenshot of github.com, captured on 5 December 2026, signed out. GitHub changes its pages often, so yours may look a little different; the names in the list stay the same.
The Pull requests tab lists every open one, with filters for reviews, labels and authors:
New pull request. Starts one by choosing two branches to compare.
Open and Closed. How many are waiting, and how many were merged or closed. This project has taken over 124,000.
Filters. Narrow the list by author, label, review state and more.
One pull request. Its title, number, author and age, and whether its task list is done.
A repository’s list of pull requests on GitHub. Screenshot of github.com, captured on 5 December 2026, signed out. GitHub changes its pages often, so yours may look a little different; the names in the list stay the same.
2
Review and merge Carla’s
When reviewing, read every changed line, as the person who'll cook from it. Say what's good, ask about what's unclear, and suggest specific changes. Approve when you'd be happy for it to be in main.
Git sandbox
Open “Files changed” on pull request #1 and read Carla’s recipe. Leave a review comment
Approve it
Merge it with any of the three buttons
Pull, and find Carla’s recipe in your history
Working folder
no changes
→Staging area
nothing staged
→Repository
10 commits on main
→Remote
origin: example.com/ana/kusina.git · in step, as of your last fetch
You are in ~/kusina. Carla has opened pull request #1 on the hosting site.
Commit graph
67e435dHEAD →mainorigin/mainCover the leche flan with foil
ba04ca2Add lumpiang shanghai recipe
98a5edcAdd a script that builds the index page
d078487Make the sinigang steps clearer
145dc1eAdd pancit bihon recipe
52d1f4dSay how much salt goes in the adobo
1c17fadAdd a README
9c53888Add leche flan recipe
1f359a2Add sinigang recipe
601c654Add adobo recipe
On the hosting site: example.com/ana/kusina
Branches: add-kare-kare, main
#1 Add kare-kare recipeOpen
carla wants to merge add-kare-kare into main
Typed up from page 14 of Lola’s notebook. Lola says ground peanuts, not peanut butter.
Files changed
diff --git a/kare-kare.md b/kare-kare.md
new file mode 100644
index 0000000..2cf2018
--- /dev/null
+++ b/kare-kare.md
@@ -0,0 +1,10 @@
+# Kare-kare
+
+Oxtail in peanut sauce. Serves 6.
+
+## Ingredients
+
+- 1.5 kg oxtail
+- 1 cup ground roasted peanuts
+- 1 bunch pechay
+- bagoong to serve
Press Start over to try another button, and compare the graphs after pulling.
3
The three merge buttons
Hosts offer up to three ways to merge. Each leaves a different graph on main:
Button
What it makes on main
Carla’s two commits
Merge pull request
A merge commit with two parents, "Merge pull request #1 from…"
Kept, as they were, in a loop beside main
Squash and merge
One new ordinary commit, "Add kare-kare recipe (#1)", with all the changes
Not in main at all; only the squashed copy is
Rebase and merge
Copies of each commit, put after main's newest, no merge commit
Copied, with new hashes, in a straight line
The repository's owner chooses which buttons are allowed. Teams that want a straight history allow squash or rebase; teams that want each pull request visible as a loop allow merge. Lesson 6.5 goes further.
4
Open your own
Git sandbox
Make a branch add-turon and commit a turon recipe on it
Push the branch, with an upstream
Open a pull request from it on the hosting site, with a clear title
Working folder
no changes
→Staging area
nothing staged
→Repository
10 commits on main
→Remote
origin: example.com/ana/kusina.git · in step, as of your last fetch
You are in ~/kusina. Carla has opened pull request #1 on the hosting site.
Commit graph
67e435dHEAD →mainorigin/mainCover the leche flan with foil
ba04ca2Add lumpiang shanghai recipe
98a5edcAdd a script that builds the index page
d078487Make the sinigang steps clearer
145dc1eAdd pancit bihon recipe
52d1f4dSay how much salt goes in the adobo
1c17fadAdd a README
9c53888Add leche flan recipe
1f359a2Add sinigang recipe
601c654Add adobo recipe
On the hosting site: example.com/ana/kusina
Branches: add-kare-kare, main
#1 Add kare-kare recipeOpen
carla wants to merge add-kare-kare into main
Typed up from page 14 of Lola’s notebook. Lola says ground peanuts, not peanut butter.
Files changed
diff --git a/kare-kare.md b/kare-kare.md
new file mode 100644
index 0000000..2cf2018
--- /dev/null
+++ b/kare-kare.md
@@ -0,0 +1,10 @@
+# Kare-kare
+
+Oxtail in peanut sauce. Serves 6.
+
+## Ingredients
+
+- 1.5 kg oxtail
+- 1 cup ground roasted peanuts
+- 1 bunch pechay
+- bagoong to serve
On a real host, pushing a new branch prints a link to open a pull request, and the repository page shows a "Compare & pull request" button.
5
Spot the trap: carrying on after a squash
Spot the trapCarla
Carla’s pull request is squash-merged. She stays on her add-kare-kare branch, adds a serving note, and opens a second pull request from the same branch.
What happens if…
6
Check what you learned
Sources
Every command on this page behaves as these pages describe, and the sandbox prints what Git 2.55 prints. Hosting features (pull requests, protected branches) come from the host’s own documentation.