Skip to content

Learning Pull Requests!

akcineren edited this page Sep 23, 2025 · 1 revision

📦 Pull Requests (PR) – What They Are & How to Use Them

📚 Index


🚀 Why Use Pull Requests?

  • Code Review: Enables teammates to review your changes before merging.
  • 📜 History: Documents why and how changes were made.
  • 🔄 Collaboration: Enables discussion, suggestions, and improvements.
  • 🛡️ Safety: Prevents direct edits to critical branches like main.

🔧 How to Create a Pull Request

  1. Create a New Branch from main or another base:

    git checkout -b feature/your-feature-name
  2. Make your changes in the project, then commit them:

    git add .
    git commit -m "Add: meaningful description of the changes"
  3. Push your branch to the remote:

    git push origin feature/your-feature-name
  4. Go to GitHub → Your Repository, and you’ll usually see a prompt:

    "Compare & pull request"

    Click it.

  5. Fill in the Pull Request form:

    • Title: Short, clear description of the feature or fix.
    • Description: What did you change? Why? How does it work?
    • Base branch: main
    • Compare branch: feature/your-feature-name
  6. Click "Create Pull Request"


🔍 PR Review Process

Once the pull request is created:

  • Team members can review your changes.
  • They may approve, request changes, or comment on specific lines.
  • Once approved, the PR can be merged into the base branch by a team member (or you).

🧪 Example Workflow

# Step 1: Create a new branch
git checkout -b feature/docker-setup

# Step 2: Make your changes

# Step 3: Commit changes
git add .
git commit -m "Add: Docker support for mobile development"

# Step 4: Push the branch
git push origin feature/docker-setup

# Step 5: Open GitHub and create a pull request from feature/docker-setup → main

🏁 After Your PR is Merged

To keep your local main branch up to date:

git checkout main
git pull origin main

🧠 Extra Tip: Draft Pull Requests

If you're still working but want early feedback:

  • Click "Create draft pull request"
  • Reviewers will know it’s not ready to be merged yet, but they can comment and help you improve it.

Clone this wiki locally