
Git Advanced Workflows
Apply interactive rebase, cherry-pick hotfixes, bisect regressions, and git worktrees when shipping features and keeping branch history review-ready.
Overview
git-advanced-workflows is an agent skill most often used in Ship (also Build) that teaches interactive rebase, cherry-pick, bisect, and worktree patterns for cleaner PRs and safer multi-branch fixes.
Install
npx skills add https://github.com/wshobson/agents --skill git-advanced-workflowsWhat is this skill?
- Interactive rebase workflow to squash, reword, reorder, and drop commits before opening or updating a PR
- Cherry-pick the same fix onto multiple release branches with continue/abort conflict handling
- Manual and automated git bisect (including git bisect run) to pinpoint when a bug was introduced
- Git worktrees for parallel urgent hotfix work without stashing the main checkout
- 4 documented practical workflows
Adoption & trust: 12.5k installs on skills.sh; 36.5k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You know basic Git but messy history, multi-release patches, and mystery regressions slow every review and hotfix.
Who is it for?
Solo builders maintaining feature branches, supporting multiple release lines, or debugging when a test started failing between tags.
Skip if: Teams that forbid rewritten history on shared branches without agreement, or anyone who only needs first-day git init/add/commit basics.
When should I use this skill?
You need to clean branch history before a PR, backport fixes, bisect a failure, or work in parallel with worktrees.
What do I get? / Deliverables
You run documented rebase, cherry-pick, bisect, and worktree commands with clear conflict and safety steps so branches are PR-ready and fixes land on the right releases.
- Cleaned commit history on a feature branch
- Cherry-picked fixes on target release branches
- Identified bad commit from bisect
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Ship because the documented workflows center on PR-ready history, multi-release hotfixes, and regression hunts before merge—not day-one scaffolding. Review is where squashed commits, force-with-lease pushes, and bisect results matter for reviewers and release owners.
Where it fits
Squash fix-typo commits and reword messages before opening a PR from a long-lived feature branch.
Cherry-pick a security commit from main onto release/2.0 and release/1.9 after a production incident.
Run git bisect with npm test to find the commit that broke CI between v2.1.0 and HEAD.
Add a worktree on hotfix/critical-bug so you can patch production without abandoning in-progress feature work.
How it compares
Use for advanced branch hygiene and investigation commands—not as a replacement for a full CI/CD or code-review skill package.
Common Questions / FAQ
Who is git-advanced-workflows for?
Indie and solo developers who ship with Git daily and want agent-guided recipes for rebase, cherry-pick, bisect, and worktrees before PRs and hotfixes.
When should I use git-advanced-workflows?
During Ship when squashing commits and force-with-lease before review, when cherry-picking security fixes across release branches, when bisecting a regression between good and bad tags, or during Build when using worktrees for parallel feature and hotfix lines.
Is git-advanced-workflows safe to install?
It is documentation-style procedural knowledge with no bundled executables; review the Security Audits panel on this Prism page and avoid force-pushing or rewriting history on branches others rely on without team alignment.
SKILL.md
READMESKILL.md - Git Advanced Workflows
# git-advanced-workflows — detailed patterns and worked examples ## Practical Workflows ### Workflow 1: Clean Up Feature Branch Before PR ```bash # Start with feature branch git checkout feature/user-auth # Interactive rebase to clean history git rebase -i main # Example rebase operations: # - Squash "fix typo" commits # - Reword commit messages for clarity # - Reorder commits logically # - Drop unnecessary commits # Force push cleaned branch (safe if no one else is using it) git push --force-with-lease origin feature/user-auth ``` ### Workflow 2: Apply Hotfix to Multiple Releases ```bash # Create fix on main git checkout main git commit -m "fix: critical security patch" # Apply to release branches git checkout release/2.0 git cherry-pick abc123 git checkout release/1.9 git cherry-pick abc123 # Handle conflicts if they arise git cherry-pick --continue # or git cherry-pick --abort ``` ### Workflow 3: Find Bug Introduction ```bash # Start bisect git bisect start git bisect bad HEAD git bisect good v2.1.0 # Git checks out middle commit - run tests npm test # If tests fail git bisect bad # If tests pass git bisect good # Git will automatically checkout next commit to test # Repeat until bug found # Automated version git bisect start HEAD v2.1.0 git bisect run npm test ``` ### Workflow 4: Multi-Branch Development ```bash # Main project directory cd ~/projects/myapp # Create worktree for urgent bugfix git worktree add ../myapp-hotfix hotfix/critical-bug # Work on hotfix in separate directory cd ../myapp-hotfix # Make changes, commit git commit -m "fix: resolve critical bug" git push origin hotfix/critical-bug # Return to main work without interruption cd ~/projects/myapp git fetch origin git cherry-pick hotfix/critical-bug # Clean up when done git worktree remove ../myapp-hotfix ``` ### Workflow 5: Recover from Mistakes ```bash # Accidentally reset to wrong commit git reset --hard HEAD~5 # Oh no! # Use reflog to find lost commits git reflog # Output shows: # abc123 HEAD@{0}: reset: moving to HEAD~5 # def456 HEAD@{1}: commit: my important changes # Recover lost commits git reset --hard def456 # Or create branch from lost commit git branch recovery def456 ``` ## Advanced Techniques ### Rebase vs Merge Strategy **When to Rebase:** - Cleaning up local commits before pushing - Keeping feature branch up-to-date with main - Creating linear history for easier review **When to Merge:** - Integrating completed features into main - Preserving exact history of collaboration - Public branches used by others ```bash # Update feature branch with main changes (rebase) git checkout feature/my-feature git fetch origin git rebase origin/main # Handle conflicts git status # Fix conflicts in files git add . git rebase --continue # Or merge instead git merge origin/main ``` ### Autosquash Workflow Automatically squash fixup commits during rebase. ```bash # Make initial commit git commit -m "feat: add user authentication" # Later, fix something in that commit # Stage changes git commit --fixup HEAD # or specify commit hash # Make more changes git commit --fixup abc123 # Rebase with autosquash git rebase -i --autosquash main # Git automatically marks fixup commits ``` ### Split Commit Break one commit into multiple logical commits. ```bash # Start interactive rebase git rebase -i HEAD~3 # Mark commit to split with 'edit' # Git will stop at that commit # Reset commit but keep changes git reset HEAD^ # Stage and commit in logical chunks git add file1.py git commit -m "feat: add validation" git add file2.py git commit -m "feat: add error handling" # Continue rebase git rebase --continue ``` ### Partial Cherry-Pick Cherry-pick only specific files from a commit. ```bash # Show files in commit git show --name-only abc123 # Checkout specific files from commit git checkout abc123 -- path/to/file1.py path/to/file2.py # Stage and commit git commit -m "cherry-pick: apply specific changes from abc123" ``` -