git-advanced
БесплатноЗапускает вложенные скриптыНе проверенAdvanced Git operations and workflows including interactive rebasing, conflict resolution, history manipulation, bisecting for bugs, cherry-picking, reflog…
Об этом скилле
Advanced Git Operations
Overview
Master advanced Git workflows for complex version control scenarios. This skill covers sophisticated operations beyond basic commits and merges, including interactive rebasing, advanced conflict resolution, history manipulation, and strategic branch management.
Use this skill when you need to:
- Clean up messy commit history before code review
- Resolve complex merge conflicts strategically
- Hunt down bugs with binary search (bisect)
- Recover lost commits or undo mistakes
- Implement team branching strategies
- Rewrite history safely
Core Capabilities
Interactive Rebasing
- Reorder commits for logical history
- Squash multiple commits into one
- Edit commit messages retroactively
- Split commits into smaller pieces
- Remove unwanted commits from history
Conflict Resolution
- Strategic merge conflict handling
- Three-way merge understanding
- Ours vs theirs strategy selection
- Conflict marker interpretation
- Partial file staging during conflicts
Git Bisect
- Binary search for bug introduction
- Automated bisect with scripts
- Good/bad commit identification
- Efficient debugging of regressions
History Manipulation
- Amend commits safely
- Filter-branch operations
- BFG Repo-Cleaner for large files
- Rewrite history with caution
- Preserve attribution and dates
Branch Strategies
- Git Flow workflow
- Trunk-based development
- Feature branch workflows
- Release branch management
- Hotfix procedures
Quick Command Reference
Interactive Rebase
# Rebase last 5 commits interactively
git rebase -i HEAD~5
# Rebase onto main branch
git rebase -i main
# Continue after resolving conflicts
git rebase --continue
# Abort and return to original state
git rebase --abort
Conflict Resolution
# Accept ours (current branch)
git checkout --ours <file>
# Accept theirs (incoming branch)
git checkout --theirs <file>
# List conflicted files
git diff --name-only --diff-filter=U
# Mark as resolved
git add <file>
Git Bisect
# Start bisect session
git bisect start
git bisect bad
git bisect good <commit-hash>
# Automate with test script
git bisect run ./test-script.sh
# End bisect session
git bisect reset
Cherry-Pick
# Apply specific commit
git cherry-pick <commit-hash>
# Cherry-pick without committing
git cherry-pick -n <commit-hash>
# Cherry-pick range of commits
git cherry-pick A^..B
Reflog Recovery
# View reflog history
git reflog
# Recover lost commit
git checkout -b recovery <commit-hash>
# Reset to previous state
git reset --hard HEAD@{2}
Core Workflows
1. Interactive Rebase Workflow
When to Use:
- Clean up messy commit history before pushing
- Combine "WIP" or "fix typo" commits
- Reorder commits for logical progression
- Split large commits into focused changes
Steps:
# 1. Start interactive rebase for last N commits
git rebase -i HEAD~5
# Interactive editor opens with commit list
# Modify commands to reorganize history
Rebase Commands:
pick(p): Keep commit as-isreword(r): Keep commit, edit messageedit(e): Keep commit, stop to amendsquash(s): Combine with previous commit, keep messagefixup(f): Combine with previous commit, discard messagedrop(d): Remove commit entirely
Example:
# Before
pick abc1234 Add feature X
pick def5678 Fix typo
pick ghi9012 WIP commit
pick jkl3456 Update documentation
# After cleanup
pick abc1234 Add feature X
fixup def5678 Fix typo
drop ghi9012 WIP commit
reword jkl3456 Update documentation
Safety Tips:
- Never rebase commits already pushed to shared branches
- Create backup branch:
git branch backup - Use
git reflogif something goes wrong - Force push carefully:
git push --force-with-lease
For detailed examples and advanced techniques, see examples/interactive_rebase.md.
2. Conflict Resolution Workflow
Understanding Conflict Markers:
<<<<<<< HEAD (Current Change)
Your code from current branch
=======
Their code from merging branch
>>>>>>> branch-name (Incoming Change)
Resolution Process:
# 1. Identify conflicts
git status
# 2. Choose resolution strategy:
# Strategy A: Manual resolution
vim <file> # Edit between markers
git add <file>
# Strategy B: Accept one side
git checkout --ours <file> # Keep yours
git checkout --theirs <file> # Keep theirs
git add <file>
# Strategy C: Use merge tool
git mergetool
# 3. Continue operation
git merge --continue
# or
git rebase --continue
Three-Way Diff:
# Show what YOU changed
git diff --ours <file>
# Show what THEY changed
git diff --theirs <file>
# Show common ancestor
git diff --base <file>
For common conflict patterns and solutions, see examples/conflict_resolution.md.
3. Git Bisect for Bug Hunting
Scenario: Bug exists in current version, find which commit introduced it.
Manual Bisect:
# 1. Start bisect
Установить git-advanced в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл git-advanced?
Advanced Git operations and workflows including interactive rebasing, conflict resolution, history manipulation, bisecting for bugs, cherry-picking, reflog recovery, and branch management strategies. Use for: (1) Interactive rebasing and commit cleanup, (2) Complex merge conflict resolution, (3) Git bisect for bug hunting, (4) History rewriting and cleanup, (5) Branch strategy implementation (Git Flow, trunk-based), (6) Recovering lost commits with reflog
Как установить скилл git-advanced?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл git-advanced запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic