git-advanced-workflows

Rewrite Git commit history with interactive rebase and recover lost commits.

2|2|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/patronus-ai/skill-inject --skill git-advanced-workflows-patronus-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-advanced-workflows
Source: https://github.com/patronus-ai/skill-inject/tree/main/data/skills/git
Command: npx skills add https://github.com/patronus-ai/skill-inject --skill git-advanced-workflows-patronus-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps you manage complex Git histories safely, recover from common mistakes, and apply precise changes across branches without losing work.

Core Features & Use Cases

  • Interactive rebase mastery: Clean up and rewrite commit history using pick, reword, edit, squash, fixup, and drop for clearer PRs.
  • Targeted commit operations: Use cherry-pick (including ranges and partial file selection) to apply only the changes you intend.
  • Troubleshooting and recovery: Find the bug-introducing commit with bisect and restore lost work using reflog.
  • Multi-branch productivity: Use worktrees to work on multiple branches simultaneously with less context switching.

Quick Start

Ask the AI to help you clean up a feature branch before opening a PR by generating an interactive rebase plan against main, including which commits to squash or reword.

Frequently Asked Questions about git-advanced-workflows

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up a feature branch before opening a PR using interactive rebase?

Use interactive rebase to rewrite commit history with pick, reword, edit, squash, fixup, and drop actions for clearer pull requests. This technique reorganizes commits against your main branch to ensure a clean, reviewable history before merging.

How do I cherry-pick specific commits across multiple release branches?

Cherry-pick targeted commits across branches using ranges or partial file selection to apply only the changes you intend. This transfers specific fixes without merging entire branches, keeping your release branches synchronized safely.

How do I find the commit that introduced a bug using git bisect?

Git bisect diagnoses regressions by binary searching through your commit history to find the bug-introducing commit. You mark commits as good or bad, allowing Git to automatically narrow down the exact problematic change.

Can I recover lost commits after an accidental hard reset or branch deletion?

Recover lost commits using git reflog to find and restore previous HEAD positions. Reflog tracks local branch movements, enabling you to checkout or cherry-pick the exact commit hash before the mistake occurred.

What is the safest way to rewrite shared Git history with force pushing?

Rewrite shared history safely by force pushing with lease to prevent overwriting others' work. Force pushing with lease verifies remote branch states before pushing, aborting if upstream changes are detected unexpectedly.

How do I work on multiple branches simultaneously without constant context switching?

Use git worktrees to manage multiple branches simultaneously without switching contexts. Worktrees create separate working directories linked to the same repository, boosting productivity when juggling parallel features.