What problem does it solve?
Complex Git operations like interactive rebasing, advanced branching strategies, and recovering from mistakes can be daunting and lead to lost work or messy commit histories. This Skill provides expert guidance and practical examples for mastering advanced Git workflows, ensuring clean repositories, efficient collaboration, and confident error recovery.
Core Features & Use Cases
- Interactive Rebase: Rewrite commit history, squash commits, and reorder changes for a clean log.
- Conflict Resolution: Master strategies for resolving complex merge and rebase conflicts.
- Branch Management: Implement effective branching strategies (e.g., GitFlow, GitHub Flow) for team collaboration.
- Use Case: You've made several small commits that should be a single logical change, and then accidentally rebased incorrectly. Use this Skill to guide you through an interactive rebase to squash commits, and then use
git reflog to recover your lost changes.
Quick Start
Example: Interactive rebase to squash commits
git log --oneline # Identify commits to squash
git rebase -i HEAD~3 # Rebase last 3 commits
In editor, change 'pick' to 'squash' for desired commits
Example: Recovering lost commits with reflog
git reflog # Find the SHA of your lost commit
git reset --hard <SHA_from_reflog>