rebase

Rebases the current Git branch onto a target with optional fetch and conflict guidance.

3|1|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/heyAyushh/stacc --skill rebase-heyayushh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rebase
Source: https://github.com/heyAyushh/stacc/tree/main/configs/commands/skills/rebase
Command: npx skills add https://github.com/heyAyushh/stacc --skill rebase-heyayushh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers rebase their current Git branch onto a target branch with flexible options, reducing manual steps and history drift.

Core Features & Use Cases

  • Deterministic rebases: Rebase onto main, origin/main, origin/branch, or a local branch with optional fetch.
  • Conflict guidance: Provides a clear workflow to review, resolve, and continue after conflicts.
  • Workflow automation: Streamlines common rebase scenarios in daily development.

Quick Start

  • Rebase on local main: git rebase main
  • Rebase on origin/main (with fetch): git fetch origin; git rebase origin/main
  • Rebase on a specific local branch: git rebase <branch-name>
  • Rebase onto origin/<branch> without local copy: git fetch origin; git rebase origin/<branch>

Frequently Asked Questions about rebase

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

FAQPage Schema
How do I rebase a feature branch onto origin/main without leaving local history drift?

To rebase onto origin/main, you can fetch from origin and then run git rebase origin/main. This updates your current branch with upstream changes, applying your commits on top to maintain a clean linear history.

What is the best way to resolve conflicts when rebasing a Git branch?

When a conflict occurs during a Git rebase, you should review the flagged files, manually resolve the conflicts, and then continue the rebase process. This workflow ensures deterministic conflict resolution before applying subsequent commits.

Can I rebase my current branch onto a local branch instead of main?

Yes, you can rebase your current branch onto any local branch by specifying the branch name as the target. This applies your current commits directly onto the tip of that local branch without needing a remote fetch.

Does rebasing onto origin/branch require a local copy of that remote branch?

No, you do not need a local copy. You can fetch from origin and directly rebase onto origin/<branch>. This allows you to update your current work against a remote branch without checking it out locally first.

When should I use git fetch before rebasing onto a target branch?

You should use git fetch before rebasing when your target is a remote branch like origin/main or origin/<branch>. Fetching ensures your local repository has the latest upstream commits before the rebase applies your changes.