Merging and Closinga Pull Request (PR) in VS Code & GitHub Desktop
March 18th, 2026 5:37 PM Mr. Q Categories: github
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)
- Review PR
- Merge (Squash recommended)
- Delete remote branch
- Pull latest
main - 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
mainbranch - 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)