rebase

Rebase the current Git branch onto a target branch with guided conflict resolution.

4|Updated Sep 30, 2024
One-click install
npx skills add https://github.com/okm321/dotfiles --skill rebase-okm321
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rebase
Source: https://github.com/okm321/dotfiles/tree/main/claude/skills/rebase
Command: npx skills add https://github.com/okm321/dotfiles --skill rebase-okm321

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Rebasing a branch onto main or another target often involves repetitive fetch commands and stressful merge conflicts. This Skill automates the rebase workflow and guides careful conflict resolution so both branches' changes are preserved. ## Core Features & Use Cases - Flexible Target Selection: Rebase onto local main, origin/main, any remote branch, or any local branch based on simple arguments. - Automatic Fetching: Fetches the remote automatically when the target is a remote branch like origin/develop. - Guided Conflict Resolution: Inspects recent changes to conflicting files with git log before resolving, preserving changes from both branches. - Use Case: You have a feature branch that has drifted behind origin/main. Invoke the Skill with "origin" to fetch and rebase, and get step-by-step help resolving any conflicts that arise. ## Quick Start Ask the assistant to rebase the current branch onto origin/main and help resolve any conflicts that come up.

Frequently Asked Questions about rebase

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

FAQPage Schema
How do I rebase my current branch onto main?▼

Run the rebase Skill with no arguments to rebase onto your local main branch. Pass "origin" to fetch and rebase onto origin/main, or pass any branch name to rebase onto that specific branch.

How to rebase onto a remote branch like origin/develop?▼

Pass the remote and branch in slash form, such as "origin/develop". The Skill splits the argument, runs git fetch on the remote, then rebases onto the remote branch target.

What happens when a git rebase hits merge conflicts?▼

The Skill inspects each conflicting file with git log -p -n 3 on the target branch to understand recent changes before resolving. The goal is preserving both branches' changes, then staging the file and running git rebase --continue.

When should I ask for help instead of resolving a rebase conflict?▼

Ask for guidance when a conflict is too complex or the intent of either side's changes is unclear. Blindly picking one side can silently discard work from the target branch or your own branch.

Does this rebase workflow work with local-only branches?▼

Yes. Passing a plain branch name without a slash rebases onto that local branch without fetching. Only arguments containing a remote prefix like "origin" trigger a git fetch.