Back to Learning Path

Step 8: Pull Requests

Pull Requests (PRs) are how you propose changes to a project on GitHub. They let others review your code before merging it into the main codebase.


What is a Pull Request?

A Pull Request is a request to merge your branch into another branch (usually main). It's called a "pull request" because you're asking the project maintainer to "pull" your changes.

The Pull Request Workflow

  1. Create a new branch for your changes
  2. Make commits on that branch
  3. Push the branch to GitHub
  4. Open a Pull Request on GitHub
  5. Team reviews your code
  6. Make any requested changes
  7. PR gets merged into main!

Why Use Pull Requests?

  • Code Review — Team members can review and discuss changes before merging
  • Quality Control — Catch bugs and improve code quality
  • Documentation — PRs create a record of what changed and why
  • Collaboration — Easy way for teams to work together

How to Create a Pull Request

1. Push your branch to GitHub

After committing changes to your branch:

git push origin feature-branch-name

2. Go to GitHub

Visit your repository on GitHub. You'll see a yellow banner with a button to "Compare & pull request" — click it!

3. Write a clear title and description

Good PR Title Example:

"Add user login feature"

Good PR Description:

- Added login form component
- Implemented authentication logic
- Added tests for login feature

4. Create pull request

Click the green "Create pull request" button. You're done!

Try It Yourself

Create a test branch in your repository, make a small change (like updating the README), push it, and create your first Pull Request. Then you can merge it yourself to see the full workflow!

Quick Summary

  • Pull Requests let teams review code before merging
  • Push your branch to GitHub first
  • Write clear titles and descriptions
  • PRs improve code quality and collaboration