git

🏠 Homepage 🏠 Syllabus of Day 2 ⬅️ Previous: 🍴 Forking a Repository

6. Opening a Pull Request (PR)

What is a Pull Request?

A Pull Request (PR) is a way to propose your changes from your branch or fork to be merged into another repository’s branch (usually the main branch). It allows others to review, discuss, and approve your changes before they become part of the main codebase.

When to Open a Pull Request

How to Open a Pull Request on GitHub

  1. Push your branch to GitHub:
    git push origin my-feature-branch
    
  2. Go to your repository on GitHub.

  3. Click the “Compare & pull request” button that appears near the top of your repo.

  4. Fill in the PR title and description:
    • Title: A short summary of your changes.
    • Description: Details about what you changed and why.
  5. Select the base repository and branch you want to merge into (usually main), and the compare branch (your feature branch).

  6. Submit the pull request.

Example PR Title and Description

What Happens Next?

Summary Table

Step Action/Description
Push branch git push origin my-feature-branch
Open PR Click “Compare & pull request” on GitHub
Fill PR details Add title and description
Submit PR Click “Create pull request”

Tip:
Write clear titles and descriptions to help reviewers understand your changes.

➡️Up Next: 👥 Adding Collaborators