Enhancing Skills

Merging and Closinga Pull Request (PR) in VS Code & GitHub Desktop

Overview

Once your PR is ready, you will:

  • Review the changes
  • Merge the PR
  • Delete the branch
  • Sync your local repo

This guide includes merge options and when to use them, plus full step-by-step instructions.


Merge Options (Important)

Squash and Merge (Recommended)

  • Combines all commits into one clean commit
  • Best for:
    • Docs PRs
    • Small features
    • Keeping history clean

Create a Merge Commit

  • Keeps all commits + adds a merge commit
  • Best for:
    • Larger features
    • When commit history matters

Rebase and Merge

  • Replays commits on top of main (no merge commit)
  • Best for:
    • Linear history
  • ⚠️ Avoid if unsure (can rewrite history)

πŸ‘‰ Recommendation for your workflow:
Use Squash and Merge




Option 1: Using VS Code

Step 1: Open the Pull Request

  • Open VS Code
  • Go to Source Control / GitHub panel
  • Click Pull Requests
  • Select your PR

πŸ‘‰ Or open it in the browser (often easier)


Step 2: Review the PR

Before merging:

  • Check Files changed
  • Confirm:
    • Only intended files are included
    • No accidental code changes (docs-only PR)

Step 3: Merge the PR

In VS Code or browser:

  • Click Merge Pull Request
  • Choose:
    • βœ… Squash and merge (recommended)

Click:

  • Confirm Merge

Step 4: Delete the Remote Branch

After merge, GitHub shows:

  • Delete branch

Click it βœ…


Step 5: Update Local Repository

Switch to main:

git checkout main

Pull latest changes:

git pull

Step 6: Delete Local Branch

git branch -d docs/engine-core-boundary



Option 2: Using GitHub Desktop

Step 1: Open the PR

  • In GitHub Desktop β†’ click View on GitHub

Step 2: Review Changes

  • Check:
    • Files changed
    • Commit message
    • PR description

Step 3: Merge the PR

In browser:

  • Click Merge Pull Request
  • Select:
    • βœ… Squash and merge

Click:

  • Confirm Merge

Step 4: Delete Remote Branch

  • Click Delete branch

Step 5: Sync GitHub Desktop

Back in GitHub Desktop:

  • Click Fetch origin
  • Click Pull

Step 6: Switch to Main Branch

  • Branch dropdown β†’ select main

Step 7: Delete Local Branch

  • Go to Branch menu β†’ Delete branch
  • Select:
docs/engine-core-boundary

Recommended Workflow (Always Follow)

  1. Review PR
  2. Merge (Squash recommended)
  3. Delete remote branch
  4. Pull latest main
  5. Delete local branch

Common Mistakes to Avoid

  • ❌ Merging without reviewing files
  • ❌ Using wrong merge type (default isn’t always best)
  • ❌ Forgetting to delete branch
  • ❌ Not pulling latest changes
  • ❌ Continuing work on a merged branch

Pro Tip

For your architecture workflow:

  • One PR = one clean commit
  • Always use:
    • Squash and merge
  • Keeps history readable like:
PR-001 β†’ engine/core boundary
PR-002 β†’ runtime lifecycle
PR-003 β†’ object system cleanup

Summary

After merging a PR, your repo should be:

  • Clean main branch
  • No leftover feature branches
  • Fully synced locally
  • Clear commit history

Next Step

After closing PR-001, you’re ready to:

  • Move to BUILD_PR for engine/core
  • Or start PR-002 (runtime lifecycle improvements)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.