Skip to content

Git Advanced Workflows

Rebase, cherry-pick, bisect, worktrees and reflog recovery for cleaner Git history.

Repository
wshobson/agents
Stars
42,095
Licence
MIT
Files
2 files

What it does

When installed, the agent gets detailed guidance for advanced Git tasks such as rewriting commit history with interactive rebase, copying specific commits between branches, using bisect to find the commit that introduced a bug, working on several branches at once with worktrees, and recovering lost commits or branches using the reflog. It works mainly by giving the agent step-by-step command patterns and safety practices, such as making backup branches and using --force-with-lease instead of --force.

Great for

  • Developers who want help tidying a messy branch before opening a pull request
  • Engineers who lost commits or a branch and need a recovery path
  • Teams hunting down when a bug was introduced in a long history

Skip it if

  • Beginners who do not yet understand Git: rewriting history can lose work if misused, and the skill assumes working knowledge
  • Shared or already-pushed branches: rebasing published commits can break collaborators' work

Try asking

  • “Squash the last five commits on my feature branch into clean, logical commits before I open a PR”
  • “Help me find which commit broke the login tests using git bisect”
  • “Recover a branch I accidentally deleted yesterday”
  • “Set up a worktree so I can work on a hotfix without stashing my current changes”
Step-by-step guide: how to use Git Advanced WorkflowsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 2 original files, the MIT licence and an attribution note.

    git-advanced-workflows.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip git-advanced-workflows.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip git-advanced-workflows.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Create a backup branch before any rebase or reset so you can return to the previous state
  • Commit or stash your work before running git bisect, and check git status before any --hard reset
  • Ask the agent to explain each command before running destructive ones, since it may run git commands that rewrite history

What's inside

  • references/details.md
  • SKILL.md

Redistributed unmodified from wshobson/agents under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.