dyad:pr-rebase
GitHub将当前分支基于最新上游代码进行变基,自动处理冲突并推送。适用于PR合并前的代码同步与冲突解决场景。
Trigger Scenarios
Install
npx skills add dyad-sh/dyad --skill dyad:pr-rebase -g -y
SKILL.md
Frontmatter
{
"name": "dyad:pr-rebase",
"description": "Rebase the current branch on the latest upstream changes, resolve conflicts, and push."
}
PR Rebase
Rebase the current branch on the latest upstream changes, resolve conflicts, and push.
Instructions
-
Determine the git remote setup:
git remote -v git branch -vvIn GitHub Actions for cross-repo PRs:
originpoints to the head repo (fork) - this is where you pushupstreampoints to the base repo - this is what you rebase onto
For same-repo PRs,
originpoints to the main repo and there may be noupstream. -
Fetch the latest changes:
git fetch --all -
Rebase onto the base branch:
Use
upstream/mainif theupstreamremote exists (cross-repo PR), otherwise useorigin/main:# Check if upstream remote exists git remote get-url upstream 2>/dev/null && git rebase upstream/main || git rebase origin/main -
If there are merge conflicts:
-
Identify the conflicting files from the rebase output
-
Read each conflicting file and understand both versions of the changes
-
Resolve the conflicts by editing the files to combine changes appropriately
-
Stage the resolved files:
git add <resolved-file> -
Continue the rebase:
git rebase --continue -
Repeat until all conflicts are resolved and the rebase completes
-
-
Run lint and push:
Run the
/dyad:pr-pushskill to run lint checks, fix any issues, and push the rebased branch. -
Summarize the results:
- Report that the rebase was successful
- List any conflicts that were resolved
- Note any lint fixes that were applied
- Confirm the branch has been pushed
Version History
- 7158f6f Current 2026-08-20 16:43


