← ClaudeAtlas

rebaselisted

Fetch the latest default branch and rebase the current branch on top of it, resolving any merge conflicts automatically. Use when asked to "rebase", "rebase on main", "update branch with main", "sync with main", "rebase onto latest", or "/rebase".
Stormix/transcripts-mcp · ★ 10 · AI & Automation · score 79
Install: claude install-skill Stormix/transcripts-mcp
# Rebase Current Branch on Latest Main Fetch the latest default branch from `origin` and rebase the current branch on top of it, resolving conflicts as they appear. Do not push unless the user asks. ## Step 1: Pre-Flight Checks Before doing anything, verify the working tree state: 1. Run `git status --porcelain=v1 --branch`. Confirm there are no uncommitted changes. If there are: - List them to the user - Ask whether to stash (`git stash push -u -m "rebase-skill autostash"`) or abort - Do NOT silently discard work 2. Run `git rev-parse --abbrev-ref HEAD` to capture the current branch name. If it is `main`, `master`, or the default branch, stop and tell the user there is nothing to rebase. 3. Determine the default branch: ```bash gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name' ``` Fall back to `git symbolic-ref refs/remotes/origin/HEAD --short | sed 's@^origin/@@'` if `gh` is unavailable. Cache the result as `$BASE`. 4. Confirm an `origin` remote exists with `git remote get-url origin`. ## Step 2: Fetch the Latest Base Fetch only what is needed and prune stale refs: ```bash git fetch --prune origin "$BASE" ``` If the fetch fails (network/auth), report the exact error and stop. Do not start a rebase against stale refs. ## Step 3: Start the Rebase Run: ```bash git rebase "origin/$BASE" ``` Capture both stdout and stderr. There are three outcomes: | Outcome | How to Detect