The Pull Request (PR) is the foundational collaboration workflow of modern software engineering. It is how developers propose changes, invite teammates to review code, run automated tests, and safely merge features into production.
1. What is a Pull Request?
A Pull Request is not a Git command—it is a feature popularized by GitHub. When you create a Pull Request, you are literally asking the maintainers:
"I have finished developing feature X on branch feature-auth. Would you please pull my commits into your main branch?"
1Your Branch: (C1) ---> (C2) [feature-auth]
2 |
3 [ Pull Request ]
4 |
5Target Branch: (C1) <---------------+ (main)
2. The Complete Pull Request Workflow
Professional software teams follow this 6-step PR cycle daily:
A yellow notification banner will appear: "feat-stripe-checkout had recent pushes... Compare & pull request". Click it!
3
Select the base branch (main) and the compare branch (feat-stripe-checkout).
4
Write a descriptive Title and Description:
What problem does this solve?
What approach did you take?
How can the reviewer test it?
1
Click Create pull request.
3. Writing an Exceptional PR Description
A high quality PR description accelerates code reviews and prevents misunderstandings. Industry-standard PR template:
1## Summary
2Integrates Stripe checkout API to allow customers to pay for course subscriptions online.
3
4## Changes Made
5- Added `stripe` npm dependency.
6- Implemented `/api/checkout` endpoint with Webhook signature verification.
7- Created checkout modal in `src/components/CheckoutModal.jsx`.
8
9## How to Test
101. Run `npm install` and `npm run dev`.
112. Navigate to `/courses/python-for-beginners`.
123. Click "Enroll Now" and verify test card numbers succeed.
13
14## Closes
15Closes #42
Pro Tip
[!TIP]
Writing keywords like Closes #42 or Fixes #15 in your PR description tells GitHub to automatically close the associated issue when the PR is merged!
4. Merging Options on GitHub
When a PR is approved by reviewers and passes all CI/CD checks, maintainers have three merge strategies available:
1[ Merge pull request ] v
2--------------------------
31. Create a merge commit : Creates a 3-way merge commit preserving all commits and branch context.
42. Squash and merge : Combines all commits into a single clean commit on main (keeps main history spotless!).
53. Rebase and merge : Re-applies commits linearly without a merge commit.
Interactive Quiz• Knowledge Check
Practice Quiz
Question 1
What is the primary purpose of a Pull Request (PR) on GitHub?
Question 2
When creating a Pull Request, what is the "base" branch?
Question 3
What happens when you include the phrase Fixes #104 in a GitHub Pull Request description?
Question 4
What does the "Squash and merge" option do when merging a Pull Request?
Question 5
What is a "Draft Pull Request" on GitHub?
Next Lesson
Code Reviews, Inline Comments, Approvals and Changes Requested
Continue learning with hands-on practice, examples, and exercises in the upcoming topic.