gh:pr-resolve-conflict

Rebase GitHub PRs onto their base with per-file conflict resolution.

Updated May 31, 2025
One-click install
npx skills add https://github.com/dEitY719/dotfiles --skill gh-pr-resolve-conflict
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh:pr-resolve-conflict
Source: https://github.com/dEitY719/dotfiles/tree/main/claude/skills/gh-pr-resolve-conflict
Command: npx skills add https://github.com/dEitY719/dotfiles --skill gh-pr-resolve-conflict

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Conflicts on pull requests require a safe and deterministic rebase flow to keep history clean and avoid accidental merges; this skill guides you through automatic rebasing, per-file conflict resolution prompts, and a guarded push with --force-with-lease.

Core Features & Use Cases

  • PR conflict resolution via rebase: auto-detects the target PR, fetches the base, rebases onto origin/<base>, and guides per-file resolutions.
  • Safety and guardrails: prints a backup SHA, auto-stashes dirty worktrees, and refuses to operate on the default branch or without explicit confirmation when needed.
  • Workflow applicability: ideal for teams enforcing a rebase-only policy; use when PRs report conflicts after base updates; ensures final push uses --force-with-lease and validates PR status via gh pr view.

Quick Start

Run the command on your PR branch to automatically rebase onto the target base, resolve conflicts with guided prompts, and push with --force-with-lease when ready.

Frequently Asked Questions about gh:pr-resolve-conflict

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

FAQPage Schema
How do I resolve GitHub PR conflicts with a rebase instead of a merge?

Resolve PR conflicts with a safe rebase flow by fetching the base branch, rebasing onto origin/<base>, and addressing conflicts per file. This skill automates that workflow, prompting user decisions and verifying final mergeability via gh pr view.

What is the safest way to force push a rebased pull request branch?

The safest way to force push a rebased pull request is using git push --force-with-lease. This skill enforces this guarded push method to prevent overwriting remote commits, while also printing a backup SHA before starting.

How do I handle unresolved Git conflicts when my PR base branch gets updated?

Handle unresolved Git conflicts from an updated base by auto-stashing dirty worktrees, rebasing onto the new origin/<base>, and resolving conflicts per file. The workflow ensures a clean history without accidental merges.

Can I use this rebase conflict resolution workflow on the default branch?

No, you cannot use this rebase conflict resolution workflow on the default branch. The skill includes safety guardrails that explicitly refuse to operate on the default branch to protect critical history.

Why do I need a backup SHA before rebasing pull request commits?

You need a backup SHA before rebasing pull request commits to safeguard your history and allow recovery if the rebase fails. This skill prints a backup SHA upfront and auto-stashes dirty worktrees for protection.