Agent skill

Git Rebase onto Base Branch

by VeryGoodOpenSource in VeryGoodOpenSource/vgv-wingspan

Rebases the current feature branch onto the latest main, master or develop, stashing uncommitted work first and aborting cleanly if conflicts appear.

MITAuto-check passedDevelopment

Install Git Rebase onto Base Branch

skills CLI
$ npx skills add VeryGoodOpenSource/vgv-wingspan --skill rebase -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install VeryGoodOpenSource/vgv-wingspan rebase --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/VeryGoodOpenSource/vgv-wingspan.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/rebase .claude/skills/rebase && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rebase
GitHub stars
108
Token cost
~786 tokens
SKILL.md length
359 words
Files
2 (incl. scripts)
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Rebases the current feature branch onto the latest main, master or develop, stashing uncommitted work first and aborting cleanly if conflicts appear.

  • Works in 3 steps: Validate preconditions → Fetch and check → Rebase
  • Bringing a feature branch up to date with main before opening a pull request
  • SKILL.md covers Step 1: Validate preconditions, Step 2: Fetch and check, Step 3: Rebase and Gotchas, plus 1 more section
  • Runs Shell scripts from its folder; calls git

What it does

The skill runs a fixed three-step routine. It first checks preconditions: it stops if you are already on main, master or develop or in a detached HEAD state, finds the base branch with the bundled detect-base-branch.sh script, and, when the working tree is dirty, asks whether to stash and rebase or cancel. It then fetches the base branch from origin and compares the merge base with the remote tip, stopping if the branch is already current.

The third step runs git rebase against the origin branch and reports how many commits your branch is ahead. On a conflict it aborts the rebase, restores any stashed changes and tells you to resolve it manually. Gotchas warn that rebasing a pushed branch rewrites history and needs a force-push with lease, and that git stash pop can itself conflict. Allowed tools are limited to the script and git fetch, rebase and stash commands.

When your agent uses it

  • Bringing a feature branch up to date with main before opening a pull request
  • Preventing merge conflicts from piling up on a long-running branch
  • Rebasing safely when you have uncommitted changes in the working tree
  • Finding out whether a branch is already current with its base

Example prompts

  • “Rebase my feature branch onto the latest main.”
  • “Update this branch from develop, and stash my local edits first.”
  • “Is my branch behind master? If so, rebase it and tell me how many commits I am ahead.”
  • “Rebase and stop cleanly if there are conflicts; I will resolve them by hand.”

Requirements

  • A Git repository with an origin remote
  • Compatibility (from SKILL.md): Designed for Claude Code (or similar products with git access)
  • Pre-approved tools (allowed-tools): Bash(*/scripts/detect-base-branch.sh), Bash(git fetch *), Bash(git rebase *), Bash(git stash *)

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Validate preconditions
  2. Fetch and check
  3. Rebase

What it can do on your machine

Read from SKILL.md and the folder at commit 19e0695. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(*/scripts/detect-base-branch.sh)
    • Bash(git fetch *)
    • Bash(git rebase *)
    • Bash(git stash *)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code (or similar products with git access)

    From compatibility in the SKILL.md frontmatter.

Context cost

Git Rebase onto Base Branch loads about 786 tokens when it runs. Until then it costs about 21 tokens; SKILL.md has 359 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~21
When it runs · the whole SKILL.md, loaded when a task matches
~786

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from VeryGoodOpenSource/vgv-wingspan at commit 19e0695, republished under its MIT licence (© VeryGoodOpenSource). 359 words, ~786 tokens.

Download SKILL.mdSave it as .claude/skills/rebase/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
rebase
description
Rebases the current feature branch onto the base branch (main/master/develop).
allowed-tools
Bash(*/scripts/detect-base-branch.sh), Bash(git fetch *), Bash(git rebase *), Bash(git stash *)
compatibility
Designed for Claude Code (or similar products with git access)
user-invocable
true
disable-model-invocation
true
when_to_use
Use when user says "rebase", "sync branch", or "update branch".
effort
low

Rebase onto base branch

Rebase the current feature branch onto the latest base branch to keep it up-to-date and prevent merge conflicts from accumulating.

Step 1: Validate preconditions

Run these checks in order. If any fail, inform the user and stop.

Detect current branch and base branch
bash
git rev-parse --abbrev-ref HEAD

If the result is main, master, or develop — inform the user they're already on the base branch and stop.

Detect the base branch:

bash
${CLAUDE_SKILL_DIR}/scripts/detect-base-branch.sh

If the script exits with an error, inform the user no base branch was found and stop.

Check for uncommitted changes
bash
git status --porcelain

If there are uncommitted changes, use AskUserQuestion:

Question: "You have uncommitted changes. Rebase requires a clean working tree. What would you like to do?"

Options:

  1. Stash and rebase (Recommended) — git stash before rebasing, git stash pop after
  2. Cancel — stop without changes

Step 2: Fetch and check

bash
git fetch origin <base-branch> --quiet

Compare the merge base with the remote base:

bash
git merge-base HEAD origin/<base-branch>
git rev-parse origin/<base-branch>

If they match, the branch is already up-to-date. Inform the user and stop.

Step 3: Rebase

bash
git rebase origin/<base-branch>
On success

Report how many commits ahead of the base branch:

bash
git rev-list --count origin/<base-branch>..HEAD
On conflict

Abort the rebase:

bash
git rebase --abort

If changes were stashed in Step 1, restore them with git stash pop.

Inform the user that the rebase had conflicts and suggest resolving manually:

Automatic rebase failed due to conflicts. To resolve manually, run: git rebase origin/<base-branch>

Show full SKILL.md (142 more words)Show less

Gotchas

  • If the branch has already been pushed to a remote, rebasing rewrites history. The user will need to force-push (git push --force-with-lease) after a successful rebase — warn them.
  • git stash pop can itself cause conflicts if stashed changes overlap with rebased commits. If stash pop fails, inform the user and suggest git stash show to review the stashed changes.
  • Detached HEAD state (HEAD instead of a branch name) means the user is not on any branch. Inform them and stop — do not attempt to rebase.
  • If the base branch does not exist locally but does on the remote, git fetch in Step 2 will create the remote tracking ref. The rebase uses origin/<base-branch>, not the local branch.

Important

  • This skill only manages git state. Do not modify project files.
  • If changes were stashed, always restore them — even if the rebase fails.

© VeryGoodOpenSource, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in skills/rebase of VeryGoodOpenSource/vgv-wingspan.

  • SKILL.md
  • scripts/detect-base-branch.sh

Open the folder on GitHubat commit 19e0695

Compare with similar skills

Git Rebase onto Base Branch next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Git Rebase onto Base Branch compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Git Rebase onto Base Branch this skillVeryGoodOpenSource/vgv-wingspan108—~786Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Code Design Rationale Investigatorcursor/plugins10k9 repos~2.6kAutomated safety check: PassNone
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Migrate Internal Package into GhostTryGhost/Ghost55k—~3.8kAutomated safety check: PassMIT
Create Pull Requestcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Official

    Digs into why code is shaped the way it is by checking git history, pull requests and connected tools in parallel, then reporting a cited read on the tradeoffs.

    10k GitHub starsUsed in 9 repos~2.6k tokens
    DevelopmentAuto-check passed
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    55k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

    70k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Git Merge Conflict Resolver

    tailcallhq/forgecode

    Resolves Git merge conflicts with a plan-first workflow that keeps both sides' intent, regenerates lock files and backs up deleted-but-modified files.

    7.6k GitHub starsUsed in 1 repo~4.5k tokens
    DevelopmentAuto-check passed

More from VeryGoodOpenSource/vgv-wingspan

All 11 skills in this repo
  • On-Demand Code Review

    VeryGoodOpenSource/vgv-wingspan

    Runs parallel review agents over a branch, chosen paths or a whole project and merges their findings into one numbered report you can act on by id.

    108 GitHub stars~1.7k tokensUpdated 7 days ago
    Auto-check passed
  • Feature Brainstorm

    VeryGoodOpenSource/vgv-wingspan

    Clarifies what to build before how, by asking one question at a time about a feature idea and then handing the result on to planning.

    108 GitHub stars~1.8k tokensUpdated 7 days ago
    Auto-check passed
  • Create Pull Request

    VeryGoodOpenSource/vgv-wingspan

    Stages, commits, pushes and opens a pull request with a Conventional Commits message, after running the project's checks unless told to skip them.

    108 GitHub stars~1.3k tokensUpdated 7 days ago
    Auto-check: notes
  • Post-Incident Debrief

    VeryGoodOpenSource/vgv-wingspan

    Produces a blameless post-incident debrief with timeline, root cause and follow-up actions after an outage, failed release or significant bug, while details are fresh.

    108 GitHub stars~1.9k tokensUpdated 7 days ago
    Auto-check passed
  • Targeted Emergency Bug Fix

    VeryGoodOpenSource/vgv-wingspan

    Applies a minimal fix to an emergency bug through triage, root-cause location, a hotfix branch and a blast-radius check, with tests and review still required.

    108 GitHub stars~1.9k tokensUpdated 7 days ago
    Auto-check passed
  • Plan

    VeryGoodOpenSource/vgv-wingspan

    Turns high-level brainstorming and ideas into well-structured, actionable implementation plans.

    108 GitHub stars~2.8k tokensUpdated 7 days ago
    Auto-check passed

Works with

Categories

Questions about Git Rebase onto Base Branch

What does Git Rebase onto Base Branch do?

Rebases the current feature branch onto the latest main, master or develop, stashing uncommitted work first and aborting cleanly if conflicts appear. The skill runs a fixed three-step routine.sh script, and, when the working tree is dirty, asks whether to stash and rebase or cancel.

When should I use Git Rebase onto Base Branch?

Git Rebase onto Base Branch fits situations like: bringing a feature branch up to date with main before opening a pull request; preventing merge conflicts from piling up on a long-running branch; rebasing safely when you have uncommitted changes in the working tree; finding out whether a branch is already current with its base.

How do I install Git Rebase onto Base Branch in Claude Code?

Run `npx skills add VeryGoodOpenSource/vgv-wingspan --skill rebase -a claude-code`. Or copy the skill folder (skills/rebase in VeryGoodOpenSource/vgv-wingspan) into .claude/skills/rebase in your project. Claude Code loads it when a task matches its description.

How do I install Git Rebase onto Base Branch in Codex?

Run `npx skills add VeryGoodOpenSource/vgv-wingspan --skill rebase -a codex`. Or copy the skill folder (skills/rebase in VeryGoodOpenSource/vgv-wingspan) into .agents/skills/rebase in your project. Codex loads it when a task matches its description.

Can I use Git Rebase onto Base Branch in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add VeryGoodOpenSource/vgv-wingspan --skill rebase -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rebase, .gemini/skills/rebase, .github/skills/rebase and .opencode/skills/rebase in your project.

What does Git Rebase onto Base Branch need to run?

Going by SKILL.md and its folder, Git Rebase onto Base Branch needs a shell for the scripts in its folder and the command-line tools its instructions call (git). Our summary lists: A Git repository with an origin remote. Its frontmatter pre-approves these tools: Bash(*/scripts/detect-base-branch.sh), Bash(git fetch *), Bash(git rebase *), Bash(git stash *). Compatibility (from SKILL.md): Designed for Claude Code (or similar products with git access).

Does Git Rebase onto Base Branch access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Git Rebase onto Base Branch safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Git Rebase onto Base Branch use?

Git Rebase onto Base Branch is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Git Rebase onto Base Branch use?

About 786 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Git Rebase onto Base Branch?

Skills that share tags, products or a category with Git Rebase onto Base Branch: Finishing a Development Branch (obra/superpowers, 296k stars), Code Design Rationale Investigator (cursor/plugins, 10k stars), Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars) and Migrate Internal Package into Ghost (TryGhost/Ghost, 55k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Git Rebase onto Base Branch?

VeryGoodOpenSource (a GitHub organization) maintains it in VeryGoodOpenSource/vgv-wingspan, which has 108 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on September 30, 2026.

Source: VeryGoodOpenSource/vgv-wingspan on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.