From git-workflow
Rebases local Git commits on top of remote branch updates for the current branch. Performs state verification, fetching, conflict checks, interactive mode, and resolution guidance. Use after colleagues push to shared branches.
npx claudepluginhub jpoutrin/product-forge --plugin git-workflowThis skill uses the workspace's default tool permissions.
**Category**: Development
Rebases current feature branch onto latest base branch (main/master/develop). Validates preconditions, stashes uncommitted changes, fetches updates, handles conflicts, and aborts on failure.
Rebases current Git branch onto local main, origin/main, or specified branch with smart conflict resolution using git log to analyze target changes and preserve both sides.
Rebases current branch against target (default: main) to incorporate upstream changes. Stops on conflicts; --fix mode adds autonomous resolution and test-fix loops.
Share bugs, ideas, or general feedback.
Category: Development
rebase [--interactive]
--interactive: Use interactive rebase for more control over commits (optional)Rebases your local commits on top of the latest remote changes for your active branch. This is useful when your colleague has pushed changes to the same branch and you want to incorporate them while keeping your commits on top.
This command delegates to the rebase-expert agent (Haiku model) for fast execution.
Delegation: Use the Task tool with:
subagent_type: "git-workflow:rebase-expert"prompt: Include the interactive flag if specified and current working directoryExample:
Task(subagent_type="git-workflow:rebase-expert", prompt="Run rebase in /path/to/repo")
When this command is run, Claude Code should:
Verify Git State
Fetch Latest Remote Changes
git fetch origin to get the latest remote changesorigin/main)Check for Conflicts
git rebase --dry-run origin/<branch> to detect potential conflictsExecute Rebase
git rebase origin/<branch> (or git rebase -i for interactive mode)Handle Conflicts (if any)
Confirm Success
🔍 Checking repository state...
Current branch: feature/my-feature
Tracking branch: origin/feature/my-feature
Status: Clean (no uncommitted changes)
📡 Fetching latest remote changes...
✅ Fetched successfully
Remote branch updated: origin/feature/my-feature
🔎 Checking for potential conflicts...
✅ No conflicts expected
Your commits can be cleanly rebased on top of the remote changes.
⏳ Rebasing your changes...
Rebasing 3 commits...
✅ Successfully rebased!
Your commits are now on top of the latest remote changes.
📊 Rebase complete!
New commit history:
abc1234 (HEAD -> feature/my-feature) your third commit
def5678 your second commit
ghi9012 your first commit
jkl3456 (origin/feature/my-feature) colleague's latest commit
Commits rebased: 3
If conflicts occur during rebase:
⚠️ Conflicts detected during rebase!
Conflicted files:
M src/auth/login.py
M src/config.py
You can:
1. Resolve conflicts in your editor
2. Run `git add <file>` after resolving
3. Continue with `git rebase --continue`
Or abort with: git rebase --abort
❌ Not in a git repository
Navigate to a git repository and try again.
❌ Uncommitted changes detected
Stash or commit your changes first:
- `git stash` to temporarily save changes
- `git add .` and `git commit` to commit them
❌ Current branch is not tracking a remote
Set up tracking with: git branch -u origin/<branch>
❌ Rebase in progress
Complete or abort the current rebase first:
- `git rebase --continue` to complete
- `git rebase --abort` to cancel
Use rebase when:
Use merge when: