A Claude Code slash command for rebasing multiple branches onto a target branch.
# Clone to your preferred location
git clone git@github.com:claude-commands/command-rebase-all.git <clone-path>/command-rebase-all
# Symlink (use full path to cloned repo)
ln -s <clone-path>/command-rebase-all/rebase-all.md ~/.claude/commands/rebase-all.md/rebase-all # Rebase all local branches onto main/master
/rebase-all develop # Rebase onto develop branch
/rebase-all --dry-run # Show what would be rebased
/rebase-all main feature-* # Rebase only feature branches
- Identifies target branch (main/master/develop)
- Lists all local branches and their status
- Checks for uncommitted changes
- Rebases each branch onto target
- Handles conflicts or reports failures
- Generates summary report
Rebase Complete
Successfully Rebased (4):
| Branch | Commits | Conflicts | Status |
| ------------ | ------- | --------- | ------- |
| feature-auth | 3 | 0 | Rebased |
| feature-api | 5 | 1 | Rebased |
Failed (1):
| Branch | Reason |
| ---------- | -------------------------- |
| feature-db | Unresolved conflicts |
| Option | Description |
|---|---|
--dry-run |
Preview without executing |
--force |
Continue past conflicts |
--backup |
Create backup refs before rebasing |
--exclude |
Skip branches matching pattern |
- Dry run mode for previewing changes
- Stash check for uncommitted changes
- Force-with-lease for safe pushes
- Automatic conflict detection
- Git
- Claude Code with Opus 4.5 model access
cd <clone-path>/command-rebase-all && git pull