rebase-pr

Rebase a PR branch onto its verified base and resolve conflicts by intent.

1|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/pnewsam/skills --skill rebase-pr-pnewsam
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rebase-pr
Source: https://github.com/pnewsam/skills/tree/main/registry/rebase-pr
Command: npx skills add https://github.com/pnewsam/skills --skill rebase-pr-pnewsam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Rebasing a pull request onto a moved integration base often loses work, resurrects deleted code, or silently overwrites remote changes. This Skill turns a risky Git operation into a reconciled, validated candidate with preserved recovery history. ## Core Features & Use Cases - Intent-based conflict resolution: Resolves each conflict from the work's intent and current upstream behavior instead of picking one side wholesale. - Recovery and lease safety: Records pre-rebase heads, creates recovery refs, and pushes only with an explicit --force-with-lease tied to the observed remote head. - Post-rebase validation: Re-runs affected checks, inspects the net diff for duplication and semantic conflicts, and verifies base ancestry and PR state. - Use Case: A teammate's PR was merged while your feature branch was open. Use this Skill to rebase onto the new base, reconcile overlapping changes already upstream, validate the result, and update the PR with a lease-protected push. ## Quick Start Use the rebase-pr skill to rebase my current PR branch onto the latest main, resolve conflicts, and update the pull request.

Frequently Asked Questions about rebase-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rebase a pull request branch onto the latest main branch?▼

Fetch the verified base branch, record the pre-rebase head, create a recovery ref, then rebase onto that base and resolve each conflict from the work's intent. Validate the resulting candidate with the established checks before publishing.

How to force push a rebased branch safely on GitHub?▼

Use an explicit lease tied to the remote head observed before rewriting: --force-with-lease=refs/heads/BRANCH:EXPECTED_SHA. Never use bare force, and if the remote moved, stop and reconcile that work instead of refreshing the lease.

What happens to PR approvals after a rebase?▼

A rebase rewrites commit history, which can invalidate existing approvals depending on repository settings. The Skill explains approval invalidation when it is material and not already accepted, and never posts reviews or merges automatically.

How do I handle conflicts when changes are already merged upstream?▼

Compare both histories and identify commits whose effects are already upstream. Keep one owner for overlapping implementations, migrate callers and resources, and account for each commit as retained, superseded, or intentionally retired.

Can I preview a rebase without rewriting my branch?▼

Yes. Preview mode inspects the branch, base, and overlapping changes and proposes a resolution without rewriting history. Only an explicit rebase request authorizes the local rewrite and conflict resolution.