Lazy Merge — Local Test Merge Only
LOCAL MERGES ONLY — Does NOT push to GitHub or close PRs.
Input
Accepts: PR URL, #14, 14, or gh pr 14. If none provided, list PRs with gh pr list --limit 30.
Preconditions
bash
git rev-parse --is-inside-work-tree git remote -v gh auth status gh repo view --json name,owner
Verify ownership before proceeding. If not owned by user/org, ask how to proceed.
PR Inspection
bash
gh pr view <number> --json number,title,headRefName,baseRefName,mergeable,state,isDraft,url
Validate:
- •PR is open (not closed)
- •PR is not a draft
- •No merge conflicts (
mergeable!="CONFLICTING")
If blocking issues, warn and ask for confirmation.
Merge (LOCAL ONLY)
bash
# Fetch PR branch gh pr checkout <number> # Switch to base branch git checkout <base-branch> # Merge locally (squash or regular) git merge --squash <pr-branch> git commit -m "Local test merge of PR #<number>: <title>" # OR regular merge: git merge <pr-branch> --no-ff -m "Local test merge of PR #<number>: <title>"
CRITICAL
- •DO NOT run
git push - •DO NOT run
gh pr merge - •This is LOCAL ONLY for testing
Undo
bash
git reset --hard origin/<base-branch>