Rebase PR on Latest Upstream Changes

VerifiedCaution

Rebase the current branch on latest upstream changes, resolve conflicts, and push.

Sby Skills Guide Bot
DevelopmentIntermediate
8/29/2026
Claude Code
#git#rebase#merge-conflicts#pull-requests#workflow

Recommended for

Automated summary

This skill rebases the current branch onto the latest upstream changes, resolves any conflicts, then pushes the result.

Strengths

  • Automatically detects the remote setup (origin/upstream) to distinguish forked from same-repo PRs
  • Handles the full conflict resolution loop with git add and git rebase --continue
  • Chains into the pr-push skill to run lint checks and fix issues before pushing
  • Reports a summary of resolved conflicts and applied lint fixes

Limitations

  • Assumes the base branch is named main, with no parameter for other names
  • Depends on the /dyad:pr-push skill existing in the environment
  • Conflict resolution is left to the model's judgment, with no guarantee the merges are correct
When to use it

Use when a PR is behind its base branch and needs to be brought up to date before merging.

When not to use it

Avoid it if you don't want the branch history rewritten or if shared commits must not be rebased.

Security analysis

Caution
Quality score85/100

The skill uses powerful but legitimate git operations (fetch, rebase, push) to update a PR branch. There is no obfuscated or exfiltrating behavior, but rebasing and pushing can alter shared history, so it warrants caution rather than a fully safe rating.

Findings
  • •Instructions use git fetch/rebase/add/continue which can rewrite branch history
  • •Push step is delegated to /dyad:pr-push; behavior like force-push is not defined here
  • •No explicit guard against pushing to a protected main branch or unsafe conflict resolution
How this analysis is made

Examples

Rebase a stale PR
My PR is behind main and the CI is failing — rebase my branch on the latest upstream and push it.
Resolve conflicts during rebase
Rebase this branch onto origin/main, resolve any merge conflicts, then run lint and push.

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

  1. Determine the git remote setup:

    git remote -v
    git branch -vv
    

    In GitHub Actions for cross-repo PRs:

    • origin points to the head repo (fork) - this is where you push
    • upstream points to the base repo - this is what you rebase onto

    For same-repo PRs, origin points to the main repo and there may be no upstream.

  2. Fetch the latest changes:

    git fetch --all
    
  3. Rebase onto the base branch:

    Use upstream/main if the upstream remote exists (cross-repo PR), otherwise use origin/main:

    # Check if upstream remote exists
    git remote get-url upstream 2>/dev/null && git rebase upstream/main || git rebase origin/main
    
  4. 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

  5. Run lint and push:

    Run the /dyad:pr-push skill to run lint checks, fix any issues, and push the rebased branch.

  6. 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

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/rebase-pr-on-latest-upstream-changes-mte1liyv/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/rebase-pr-on-latest-upstream-changes-mte1liyv' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/rebase-pr-on-latest-upstream-changes-mte1liyv/download' --output '.skill-downloads/rebase-pr-on-latest-upstream-changes-mte1liyv/SKILL.md.part' && mv '.skill-downloads/rebase-pr-on-latest-upstream-changes-mte1liyv/SKILL.md.part' '.skill-downloads/rebase-pr-on-latest-upstream-changes-mte1liyv/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/rebase-pr-on-latest-upstream-changes-mte1liyv/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills