
Git Advanced Workflows
- 1 installs
- 404 repo stars
- Updated August 5, 2026
- aiskillstore/marketplace
git-advanced-workflows is a Claude Code skill for advanced Git operations like interactive rebase, cherry-pick, bisect, worktrees, and reflog recovery.
About
git-advanced-workflows is a Claude Code skill covering advanced Git techniques: interactive rebase, cherry-picking, bisect, worktrees, and reflog. A developer uses it to clean commit history before a PR, find the commit that introduced a bug, work on multiple branches at once, or recover lost commits. It gives concrete command sequences for each situation.
- Covers interactive rebase, cherry-pick, bisect, worktrees, reflog
- Includes practical workflows for cleaning history before PRs
- Explains recovering lost commits with reflog
Git Advanced Workflows by the numbers
- 1 all-time installs (skills.sh)
- Ranked #527 of 733 Git & Pull Requests skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
git-advanced-workflows capabilities & compatibility
- Capabilities
- git rebase · cherry pick · git bisect · git worktree · reflog recovery
- Use cases
- code review
What git-advanced-workflows says it does
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation.
Your safety net - tracks all ref movements, even deleted commits.
npx skills add https://github.com/aiskillstore/marketplace --skill git-advanced-workflowsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 404 |
| Last updated | August 5, 2026 |
| Repository | aiskillstore/marketplace ↗ |
What it does
Clean Git history and recover from mistakes with rebase, bisect, worktrees, and reflog.
Who is it for?
Rewriting Git history and recovering lost commits before opening a pull request.
Skip if: Non-Git tasks or basic add/commit/push flows.
When should I use this skill?
When cleaning up commit history, hunting a bug commit, or recovering from a bad reset.
By the numbers
- 5 core Git techniques covered
- 5 practical workflows
Files
Git Advanced Workflows
Master advanced Git techniques to maintain clean history, collaborate effectively, and recover from any situation with confidence.
Do not use this skill when
- The task is unrelated to git advanced workflows
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open
resources/implementation-playbook.md.
Use this skill when
- Cleaning up commit history before merging
- Applying specific commits across branches
- Finding commits that introduced bugs
- Working on multiple features simultaneously
- Recovering from Git mistakes or lost commits
- Managing complex branch workflows
- Preparing clean PRs for review
- Synchronizing diverged branches
Core Concepts
1. Interactive Rebase
Interactive rebase is the Swiss Army knife of Git history editing.
Common Operations:
pick: Keep commit as-isreword: Change commit messageedit: Amend commit contentsquash: Combine with previous commitfixup: Like squash but discard messagedrop: Remove commit entirely
Basic Usage:
# Rebase last 5 commits
git rebase -i HEAD~5
# Rebase all commits on current branch
git rebase -i $(git merge-base HEAD main)
# Rebase onto specific commit
git rebase -i abc1232. Cherry-Picking
Apply specific commits from one branch to another without merging entire branches.
# Cherry-pick single commit
git cherry-pick abc123
# Cherry-pick range of commits (exclusive start)
git cherry-pick abc123..def456
# Cherry-pick without committing (stage changes only)
git cherry-pick -n abc123
# Cherry-pick and edit commit message
git cherry-pick -e abc1233. Git Bisect
Binary search through commit history to find the commit that introduced a bug.
# Start bisect
git bisect start
# Mark current commit as bad
git bisect bad
# Mark known good commit
git bisect good v1.0.0
# Git will checkout middle commit - test it
# Then mark as good or bad
git bisect good # or: git bisect bad
# Continue until bug found
# When done
git bisect resetAutomated Bisect:
# Use script to test automatically
git bisect start HEAD v1.0.0
git bisect run ./test.sh
# test.sh should exit 0 for good, 1-127 (except 125) for bad4. Worktrees
Work on multiple branches simultaneously without stashing or switching.
# List existing worktrees
git worktree list
# Add new worktree for feature branch
git worktree add ../project-feature feature/new-feature
# Add worktree and create new branch
git worktree add -b bugfix/urgent ../project-hotfix main
# Remove worktree
git worktree remove ../project-feature
# Prune stale worktrees
git worktree prune5. Reflog
Your safety net - tracks all ref movements, even deleted commits.
# View reflog
git reflog
# View reflog for specific branch
git reflog show feature/branch
# Restore deleted commit
git reflog
# Find commit hash
git checkout abc123
git branch recovered-branch
# Restore deleted branch
git reflog
git branch deleted-branch abc123Practical Workflows
Workflow 1: Clean Up Feature Branch Before PR
# 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-authWorkflow 2: Apply Hotfix to Multiple Releases
# 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 --abortWorkflow 3: Find Bug Introduction
# 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 testWorkflow 4: Multi-Branch Development
# 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-hotfixWorkflow 5: Recover from Mistakes
# 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 def456Advanced 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
# 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/mainAutosquash Workflow
Automatically squash fixup commits during rebase.
# 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 commitsSplit Commit
Break one commit into multiple logical commits.
# 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 --continuePartial Cherry-Pick
Cherry-pick only specific files from a commit.
# 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"Best Practices
1. Always Use --force-with-lease: Safer than --force, prevents overwriting others' work 2. Rebase Only Local Commits: Don't rebase commits that have been pushed and shared 3. Descriptive Commit Messages: Future you will thank present you 4. Atomic Commits: Each commit should be a single logical change 5. Test Before Force Push: Ensure history rewrite didn't break anything 6. Keep Reflog Aware: Remember reflog is your safety net for 90 days 7. Branch Before Risky Operations: Create backup branch before complex rebases
# Safe force push
git push --force-with-lease origin feature/branch
# Create backup before risky operation
git branch backup-branch
git rebase -i main
# If something goes wrong
git reset --hard backup-branchCommon Pitfalls
- Rebasing Public Branches: Causes history conflicts for collaborators
- Force Pushing Without Lease: Can overwrite teammate's work
- Losing Work in Rebase: Resolve conflicts carefully, test after rebase
- Forgetting Worktree Cleanup: Orphaned worktrees consume disk space
- Not Backing Up Before Experiment: Always create safety branch
- Bisect on Dirty Working Directory: Commit or stash before bisecting
Recovery Commands
# Abort operations in progress
git rebase --abort
git merge --abort
git cherry-pick --abort
git bisect reset
# Restore file to version from specific commit
git restore --source=abc123 path/to/file
# Undo last commit but keep changes
git reset --soft HEAD^
# Undo last commit and discard changes
git reset --hard HEAD^
# Recover deleted branch (within 90 days)
git reflog
git branch recovered-branch abc123Resources
- references/git-rebase-guide.md: Deep dive into interactive rebase
- references/git-conflict-resolution.md: Advanced conflict resolution strategies
- references/git-history-rewriting.md: Safely rewriting Git history
- assets/git-workflow-checklist.md: Pre-PR cleanup checklist
- assets/git-aliases.md: Useful Git aliases for advanced workflows
- scripts/git-clean-branches.sh: Clean up merged and stale branches
{
"schema_version": "2.0",
"meta": {
"generated_at": "2026-02-25T02:18:41.629Z",
"slug": "sickn33-git-advanced-workflows",
"source_url": "https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/git-advanced-workflows",
"source_ref": "main",
"model": "claude",
"analysis_version": "3.0.0",
"source_type": "community",
"content_hash": "5be29612e3f169a2bd0c401eb9ed047ff0f0697fe36eb24fa67f974ceb064ed0",
"tree_hash": "e63535e671dc2a8e24ae67b80fd154f3959823647430636f8e5f401255efe7ef"
},
"skill": {
"name": "git-advanced-workflows",
"description": "Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborative branching, and need to recover from mistakes.",
"summary": "Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation",
"icon": "📦",
"version": "1.0.1",
"author": "sickn33",
"license": "MIT",
"tags": [
"git",
"version-control",
"workflows",
"devops",
"productivity"
],
"supported_tools": [
"claude",
"codex",
"claude-code"
],
"risk_factors": []
},
"security_audit": {
"risk_level": "safe",
"is_blocked": false,
"safe_to_publish": true,
"summary": "All static findings are false positives. The skill is a documentation guide for Git commands - the flagged 'external_commands' are Git examples in markdown code blocks, 'filesystem' findings are legitimate worktree relative paths, and 'weak cryptographic algorithm' was a misidentification. This is safe, legitimate educational content.",
"risk_factor_evidence": [],
"critical_findings": [],
"high_findings": [],
"medium_findings": [],
"low_findings": [],
"dangerous_patterns": [
{
"title": "External Command Detection (False Positive)",
"description": "Scanner detected 'Ruby/shell backtick execution' in markdown code blocks. These are Git command documentation examples, not executable code. No command injection risk.",
"locations": [
{
"file": "SKILL.md",
"line_start": 22,
"line_end": 386
}
],
"confidence": 0.95,
"confidence_reasoning": "All 42 flagged locations are Git commands in markdown code blocks (e.g., git rebase, git cherry-pick) which are documentation examples, not actual code execution"
},
{
"title": "Path Traversal Detection (False Positive)",
"description": "Scanner flagged '../' patterns in Git worktree commands. These are legitimate relative path specifications for Git worktree operations, not path traversal vulnerabilities.",
"locations": [
{
"file": "SKILL.md",
"line_start": 120,
"line_end": 241
}
],
"confidence": 0.95,
"confidence_reasoning": "Path patterns like '../project-feature' are hardcoded Git worktree commands, not user-controlled input. Standard Git workflow usage."
},
{
"title": "Cryptographic Algorithm Detection (False Positive)",
"description": "Scanner reported 'weak cryptographic algorithm' but no cryptographic code exists in this file. Likely misidentification of frontmatter or other content.",
"locations": [
{
"file": "SKILL.md",
"line_start": 1,
"line_end": 415
}
],
"confidence": 0.98,
"confidence_reasoning": "This is a pure Git documentation file with no encryption, hashing, or cryptographic functionality whatsoever"
}
],
"files_scanned": 1,
"total_lines": 415,
"audit_model": "claude",
"audited_at": "2026-02-25T02:18:41.629Z"
},
"content": {
"user_title": "Master Advanced Git Workflows",
"value_statement": "Developers struggle with complex Git operations like history rewriting and recovery from mistakes. This skill provides comprehensive guidance on advanced Git commands including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation.",
"seo_keywords": [
"git advanced workflows",
"git rebase tutorial",
"git cherry-pick",
"git bisect",
"git worktree",
"git reflog",
"git history rewrite",
"claude code git",
"codex git",
"claude git automation"
],
"actual_capabilities": [
"Perform interactive rebase to clean up commit history before merging",
"Cherry-pick specific commits from one branch to another",
"Use git bisect to find the commit that introduced a bug",
"Create and manage multiple worktrees for parallel development",
"Recover lost commits or branches using reflog",
"Handle merge conflicts during complex Git operations"
],
"limitations": [
"Does not execute Git commands directly - provides guidance and instructions only",
"Cannot access repositories or Git configuration",
"Requires user to manually execute recommended commands",
"Does not integrate with Git hosting platforms like GitHub or GitLab"
],
"use_cases": [
{
"title": "Clean up feature branch before pull request",
"description": "Use interactive rebase to squash, reorder, and clean commit messages before merging to main branch",
"target_user": "Software developers preparing code for review"
},
{
"title": "Find bug introduction point",
"description": "Use git bisect binary search to quickly locate which commit introduced a regression",
"target_user": "Debugging developers and QA engineers"
},
{
"title": "Recover from Git mistakes",
"description": "Use reflog to recover commits or branches that were accidentally deleted or reset",
"target_user": "Any developer who has made a mistake with Git"
}
],
"prompt_templates": [
{
"title": "Interactive rebase guide",
"prompt": "Help me use interactive rebase to clean up my feature branch. I want to squash my last 5 commits into one clean commit with a good message.",
"scenario": "Cleaning up commit history before PR"
},
{
"title": "Cherry-pick a commit",
"prompt": "How do I cherry-pick a specific commit from another branch onto my current branch? The commit hash is abc123.",
"scenario": "Applying a specific fix to current branch"
},
{
"title": "Find buggy commit",
"prompt": "I need to find which commit introduced a bug. How do I use git bisect to systematically search through my commit history?",
"scenario": "Debugging regression issues"
},
{
"title": "Worktree setup",
"prompt": "Show me how to set up a Git worktree so I can work on a hotfix while keeping my current feature work intact.",
"scenario": "Parallel development workflow"
}
],
"output_examples": [
{
"input": "How do I clean up my commit history before creating a pull request?",
"output": "Use interactive rebase to clean up your commits. Run 'git rebase -i main' to edit your last several commits. You can squash (s) multiple commits together, reword (r) commit messages, or drop (d) unnecessary commits. Always create a backup branch first with 'git branch backup-branch' before rewriting history."
},
{
"input": "I accidentally reset my branch and lost my commits. How can I recover them?",
"output": "Use git reflog to find your lost commits. Run 'git reflog' to see a history of all ref updates. Find the commit hash before the reset, then recover with 'git reset --hard <commit-hash>' or create a branch with 'git branch recovered-branch <commit-hash>'. Reflog keeps history for 90 days."
}
],
"best_practices": [
"Always create a backup branch before performing destructive Git operations like rebase or reset",
"Use --force-with-lease instead of --force when pushing rewritten history to prevent overwriting others' work",
"Run tests after rebase operations to ensure the rewritten history did not break any functionality"
],
"anti_patterns": [
"Rebasing public branches that other developers have already pulled - this causes history conflicts for collaborators",
"Using 'git push --force' without checking if others have pushed new changes to the remote",
"Running git bisect on a dirty working directory without staging or stashing changes first"
],
"faq": [
{
"question": "What is the difference between rebase and merge?",
"answer": "Rebase rewrites commit history to apply your commits on top of another branch, creating linear history. Merge combines branches without changing history. Use rebase for local cleanup before pushing, use merge for integrating completed work into shared branches."
},
{
"question": "When should I use cherry-pick instead of merge?",
"answer": "Use cherry-pick when you only need specific commits from another branch, not the entire branch history. This is useful for applying hotfixes to multiple release branches without merging all changes."
},
{
"question": "How does git bisect work?",
"answer": "Git bisect uses binary search to find the commit that introduced a bug. You mark a known bad commit and a good commit, then Git checks out commits in between. You test each one and mark good or bad until the first bad commit is found."
},
{
"question": "What is a Git worktree and when should I use it?",
"answer": "A worktree lets you check out multiple branches simultaneously in different directories. Use it when you need to work on multiple features or fixes at once without stashing your current work."
},
{
"question": "How long does reflog keep deleted commit history?",
"answer": "Reflog keeps history for 90 days by default, or until the ref is garbage collected. This provides a safety net to recover lost commits or branches within this period."
},
{
"question": "Is it safe to rewrite Git history?",
"answer": "Rewriting history is safe for local branches that have not been shared. For shared branches, only rewrite if absolutely necessary and always use 'git push --force-with-lease' to avoid overwriting others' work."
}
]
},
"file_structure": [
{
"name": "SKILL.md",
"type": "file",
"path": "SKILL.md",
"lines": 415
}
]
}
Related skills
FAQ
How do I find the commit that introduced a bug?
Use git bisect: start, mark a bad and a good commit, then test each checkout, optionally automating with git bisect run.
How do I recover commits after a bad reset?
Use git reflog to find the lost commit hash, then git reset --hard or git branch to that hash.