Guide a safe git rebase of the current branch onto a target branch, including conflict triage and resolution steps. Use when asked to rebase, update a branch, or resolve rebase conflicts.
Installation
Details
Usage
After installing, this skill will be available to your AI coding assistant.
Verify installation:
skills listSkill Instructions
name: rebase-assistant description: Guide a safe git rebase of the current branch onto a target branch, including conflict triage and resolution steps. Use when asked to rebase, update a branch, or resolve rebase conflicts.
Rebase assistant
Goal
Rebase the current branch onto a target branch safely, with built-in conflict resolution guidance.
Inputs to confirm (ask if missing)
- Target branch (explicit branch name or "default branch").
- Preferred conflict bias when ambiguous: keep ours, keep theirs, or manual merge.
- Protected paths or file types to avoid touching.
Workflow
- Identify the target branch
- If user says "default branch": discover via
git remote show origin(read "HEAD branch"). - If ambiguous or no remote: ask the user which branch to use.
- If user says "default branch": discover via
- Preflight checks
git status -sb(must be clean before rebase).git fetch --pruneto sync remotes.- Optional safety branch (ask before creating):
git branch backup/<current-branch>.
- Start the rebase
git rebase <target-branch>
- If conflicts occur, resolve (repeat per file)
- Inspect conflict list:
git status -sbgit diff --name-only --diff-filter=U
- Classify and inspect:
- Content conflicts: open file, resolve markers.
- Delete/modify or rename conflicts: decide keep vs delete explicitly.
- Binary conflicts: choose ours/theirs only.
- Show base/ours/theirs when useful:
git show :1:<path>git show :2:<path>git show :3:<path>
- File-level choice when safe:
git checkout --ours <path>git checkout --theirs <path>
- Stage resolved files:
git add <path> - Continue:
git rebase --continue
- Inspect conflict list:
- Finish and verify
- Ensure no conflicts:
git status -sb - Suggest a fast test/build if available.
- Ensure no conflicts:
Safety rules
- Never run
git reset --hard,git clean -fd, orgit rebase --abortunless the user explicitly requests it. - Always show candidate commands before applying destructive changes.
Deliverables
- The exact rebase command used and target branch.
- Conflict list grouped by type with per-file resolution guidance.
- Completion command and a short verification suggestion.
More by jMerta
View allIdentify and clean up stale git branches locally and on remotes with safe, reversible steps. Use when asked to prune, list, or delete merged/old branches or audit branch hygiene.
Fix GitHub Actions CI failures using GitHub CLI (gh): inspect runs/logs, identify root cause, patch workflows/code, rerun jobs, and summarize verification. Use when GitHub Actions CI is failing or needs diagnosis.
Reproduce, isolate, and fix a bug (or failing build/test), then summarize root cause, fix, and verification steps. Use when the user reports a bug, regression, or failing build/test and wants a fix.
Web search and content extraction via Brave Search API. Use for searching documentation, facts, or any web content. Lightweight, no browser required.