git-advanced

Guide interactive rebasing, conflict resolution, and branch strategies for Git workflows.

26|5|Updated Oct 26, 2025
One-click install
npx skills add https://github.com/AutumnsGrove/ClaudeSkills --skill git-advanced
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-advanced
Source: https://github.com/AutumnsGrove/ClaudeSkills/tree/main/git-advanced
Command: npx skills add https://github.com/AutumnsGrove/ClaudeSkills --skill git-advanced

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and examples (resource) and references (resource) components.

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>

Frequently Asked Questions about git-advanced

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

FAQPage Schema
How do I clean up messy commit history with interactive rebase?

Interactive rebase rewrites commit history by letting you squash, reorder, edit, or split commits. Run `git rebase -i HEAD~N` to rebase the last N commits, then change 'pick' to 'squash', 'reword', or 'drop' in the editor to reorganize and consolidate changes into a clean log.

How do I resolve complex merge and rebase conflicts?

Merge conflicts occur when Git cannot auto-merge changes; resolve by examining conflict markers in files, choosing which changes to keep, then staging and committing. For rebase conflicts, resolve each commit individually, then continue with `git rebase --continue`.

Can I recover lost commits after a failed rebase or reset?

Yes, use `git reflog` to view your recent Git operations and find the SHA of lost commits. Run `git reset --hard <SHA>` to restore your work, or `git cherry-pick <SHA>` to apply specific commits to your current branch.

What's the best branching strategy for team collaboration?

Common strategies include Git Flow (feature, release, hotfix branches), trunk-based development (short-lived branches off main), and GitHub Flow (feature branches with pull requests). Choose based on release frequency, team size, and deployment model.

How do I rewrite Git history safely without losing work?

Before rewriting history, create a backup branch with `git branch backup`. Use `git push --force-with-lease` instead of `--force` to prevent overwriting others' changes. Test locally before pushing to ensure the rewrite is correct.

Can I use git bisect to find which commit introduced a bug?

Yes, `git bisect` performs binary search through your history. Mark a commit as 'good' or 'bad', and bisect narrows down the exact commit that broke functionality, speeding up bug hunts in large histories.