rebase
Rebase local changes on top of remote branch updates
What this skill does
# rebase **Category**: Development ## Usage ```bash rebase [--interactive] ``` ## Arguments - `--interactive`: Use interactive rebase for more control over commits (optional) ## Description 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. ## Execution Method 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 directory Example: ``` Task(subagent_type="git-workflow:rebase-expert", prompt="Run rebase in /path/to/repo") ``` --- ## Execution Instructions for Claude Code When this command is run, Claude Code should: 1. **Verify Git State** - Check that we're in a git repository - Confirm the current branch is tracking a remote branch - Verify there are no uncommitted changes (offer to stash if needed) 2. **Fetch Latest Remote Changes** - Run `git fetch origin` to get the latest remote changes - Identify the tracking branch (e.g., `origin/main`) 3. **Check for Conflicts** - Run `git rebase --dry-run origin/<branch>` to detect potential conflicts - Warn user if conflicts are likely 4. **Execute Rebase** - Run `git rebase origin/<branch>` (or `git rebase -i` for interactive mode) - Monitor for conflicts during rebase - Provide guidance if conflicts occur 5. **Handle Conflicts (if any)** - Display conflicted files - Guide user through resolution - Verify rebase completion 6. **Confirm Success** - Show final commit log with new positions - Display summary of rebased commits ## Interactive Flow ### Step 1: Verify State ``` ๐ Checking repository state... Current branch: feature/my-feature Tracking branch: origin/feature/my-feature Status: Clean (no uncommitted changes) ``` ### Step 2: Fetch Remote Changes ``` ๐ก Fetching latest remote changes... โ Fetched successfully Remote branch updated: origin/feature/my-feature ``` ### Step 3: Check for Conflicts ``` ๐ Checking for potential conflicts... โ No conflicts expected Your commits can be cleanly rebased on top of the remote changes. ``` ### Step 4: Execute Rebase ``` โณ Rebasing your changes... Rebasing 3 commits... โ Successfully rebased! Your commits are now on top of the latest remote changes. ``` ### Step 5: Show Results ``` ๐ 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 ``` ## Conflict Handling 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 ``` ## Error Handling ``` โ 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 ``` ## When to Use Rebase vs Merge **Use rebase when:** - You want a linear commit history - You're working on a feature branch with colleagues pushing updates - You want your commits to appear on top of the latest changes **Use merge when:** - You want to preserve the complete history of both branches - Multiple people are working on the same branch and you want a clear merge point
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.