git-advanced

Guide advanced Git operations including rebase, bisect, reflog, and worktrees.

6|1|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill git-advanced-repairyourtech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-advanced
Source: https://github.com/RepairYourTech/cfsa-antigravity/tree/main/.agent/skills/git-advanced
Command: npx skills add https://github.com/RepairYourTech/cfsa-antigravity --skill git-advanced-repairyourtech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and practical examples for performing advanced Git operations, enabling users to manage complex version control scenarios efficiently and recover from potential mistakes.

Core Features & Use Cases

  • History Rewriting: Learn interactive rebase, squash, and fixup for cleaning up commit history.
  • Bug Hunting: Utilize git bisect to pinpoint the exact commit that introduced a bug.
  • Recovery: Master git reflog to recover from accidental resets or branch deletions.
  • Workflow Management: Understand worktrees, submodules vs. subtrees, and patch workflows.
  • Hooks & Conventions: Implement pre-commit hooks and adhere to Conventional Commits.
  • Performance: Optimize Git performance with partial clones and commit graphs.
  • Use Case: You've accidentally force-pushed to a shared branch and need to recover the previous state, or you need to find the exact commit that introduced a performance regression.

Quick Start

Use the git-advanced skill to learn how to recover from an accidental git reset --hard command.

Frequently Asked Questions about git-advanced

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

FAQPage Schema
How do I recover a branch after an accidental git reset --hard?

To recover a branch after an accidental git reset --hard, use the git reflog to locate the lost commit hash and run git reset --hard <hash> to restore your branch to its previous state.

How does git bisect work for finding a regression in commit history?

Git bisect uses a binary search algorithm across your commit history, requiring you to mark known good and bad commits so it can automatically checkout intermediate commits to pinpoint the exact one that introduced the regression.

What is the difference between git submodules and subtrees for managing dependencies?

Git submodules maintain dependency repositories as separate nested pointers within the parent repository, while git subtrees merge the dependency commits directly into your main project history, simplifying cloning but increasing repository size.

How do I clean up commit history with interactive rebase and squash?

To clean up commit history, initiate an interactive rebase using git rebase -i and mark target commits as squash or fixup to combine multiple commits into a single, cleaner commit before force-pushing to your remote branch.

When should I use git worktrees instead of cloning a repository multiple times?

Git worktrees should be used when you need to work on multiple branches simultaneously, allowing you to checkout separate branches into different directories while sharing a single underlying .git directory to save disk space and cloning time.

How do I optimize git performance for large repositories?

Optimize git performance for large repositories by utilizing partial clones to download only necessary objects, enabling commit graphs for faster log traversals, and using sparse checkout to limit your working directory to only the required file paths.