dyad:pr-rebase

Rebases the current branch onto upstream changes, resolves conflicts, and pushes.

21.4k|2.6k|Updated Apr 11, 2025
One-click install
npx skills add https://github.com/dyad-sh/dyad --skill dyad-pr-rebase
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dyad:pr-rebase
Source: https://github.com/dyad-sh/dyad/tree/main/.claude/skills/pr-rebase
Command: npx skills add https://github.com/dyad-sh/dyad --skill dyad-pr-rebase

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Keeping a pull request branch up to date with the base repository requires manual rebasing, conflict resolution, and force-pushing, which is error-prone and tedious, especially for cross-repo fork PRs where remote setup differs.

Core Features & Use Cases

  • Remote Detection: Automatically determines whether the PR is cross-repo (origin = fork, upstream = base) or same-repo, and rebases onto the correct target branch.
  • Conflict Resolution: Identifies conflicting files during the rebase, resolves them by merging both versions, stages the results, and continues the rebase until completion.
  • Lint and Push: Delegates to the dyad:pr-push skill to run lint checks, fix issues, and push the rebased branch.
  • Use Case: A maintainer's open PR on a fork has fallen behind the base repository's main branch; run this skill to fetch upstream, rebase, resolve any conflicts, lint, and push the updated branch.

Quick Start

Rebase my current pull request branch onto the latest upstream main, resolve any conflicts, and push the result.

Frequently Asked Questions about dyad:pr-rebase

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?

Fetch all remotes with git fetch --all, then run git rebase upstream/main for cross-repo PRs or git rebase origin/main for same-repo PRs. Resolve any conflicts, stage the files, continue the rebase, and push the branch.

How do I rebase a fork PR against the upstream repository?

In cross-repo PRs, origin points to your fork and upstream points to the base repository. Fetch all remotes, rebase onto upstream/main, then push to origin so the pull request updates with the rebased commits.

What should I do when a git rebase has merge conflicts?

Read each conflicting file, understand both versions of the changes, and edit the files to combine them appropriately. Stage resolved files with git add, run git rebase --continue, and repeat until the rebase completes.

Why does git rebase fail when the upstream remote is missing?

Same-repo PRs typically have no upstream remote, so rebasing onto upstream/main fails. Check remotes with git remote -v first and fall back to origin/main when upstream does not exist.

Should I run lint checks after rebasing a branch?

Yes, rebasing can introduce issues from newly integrated upstream changes. This skill runs the dyad:pr-push skill after rebasing to execute lint checks, fix any problems, and push the updated branch.