git-advanced

Documents git workflows for worktrees, bisect, interactive rebase, hooks, and recovery techniques.

Updated Sep 17, 2026
One-click install
npx skills add https://github.com/karenrebecag/spec-driven-standards --skill git-advanced-karenrebecag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-advanced
Source: https://github.com/karenrebecag/spec-driven-standards/tree/main/plugins/standards/skills/git-advanced
Command: npx skills add https://github.com/karenrebecag/spec-driven-standards --skill git-advanced-karenrebecag

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often lose work, struggle to find bug-introducing commits, or disrupt their flow by stashing changes when switching branches. This Skill provides concrete command patterns for parallel branch work, automated bug hunting, commit cleanup, and recovering lost commits. ## Core Features & Use Cases - Worktrees: Work on multiple branches simultaneously in separate directories without stashing or committing WIP. - Bisect: Binary-search commit history to find which commit introduced a bug, including fully automated runs with git bisect run npm test. - Hooks & Recovery: Pre-commit linting, conventional commit message enforcement, pre-push test gates, plus reflog-based recovery of deleted branches and lost commits. - Use Case: A regression appears after release v1.5.0. Run git bisect start HEAD v1.5.0 followed by git bisect run npm test to automatically identify the exact offending commit. ## Quick Start Use the git-advanced skill to set up a worktree for a hotfix branch and configure a pre-commit hook that lints staged files.

Frequently Asked Questions about git-advanced

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

FAQPage Schema
How do I work on two git branches at the same time?

Use git worktree add to create a separate working directory for another branch, for example git worktree add ../hotfix-123 -b hotfix/123 origin/main. Each worktree shares the same .git repository, so you avoid stashing or committing work in progress.

How do I find which commit introduced a bug in git?

Use git bisect to binary-search the commit history. Mark a bad commit with git bisect bad and a known good one with git bisect good, then test each midpoint. Automate it fully with git bisect run npm test.

How do I enforce conventional commit messages with git hooks?

Create a commit-msg hook in .git/hooks that validates the message against a regex like ^(feat|fix|docs|style|refactor|test|chore)(\(.+\))?: .{1,72}$. The hook exits with an error when the message does not match, blocking the commit.

How do I recover a deleted branch or lost commit in git?

Run git reflog to find the commit hash before the deletion, then recreate the branch with git checkout -b recovered-branch HEAD@{n}. For dangling commits after a reset or rebase, use git fsck --lost-found to locate them.

When should I not rebase a git branch?

Do not rebase commits that have already been pushed and shared with others, since it rewrites history and breaks their clones. Also avoid force-pushing shared branches; if you must, use --force-with-lease instead of --force.