git-advanced-3-git-bisect
Sub-skill of git-advanced: 3. Git Bisect (+2).
Best use case
git-advanced-3-git-bisect is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Sub-skill of git-advanced: 3. Git Bisect (+2).
Teams using git-advanced-3-git-bisect should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/3-git-bisect/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How git-advanced-3-git-bisect Compares
| Feature / Agent | git-advanced-3-git-bisect | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Sub-skill of git-advanced: 3. Git Bisect (+2).
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 3. Git Bisect (+2)
## 3. Git Bisect
**Basic Bisect:**
```bash
# Start bisect
git bisect start
# Mark current version as bad
git bisect bad
# Mark known good commit
git bisect good v1.0.0
# Git checks out a commit - test it
# If bad:
git bisect bad
# If good:
git bisect good
# Continue until found
# Git will show: "abc123 is the first bad commit"
# End bisect
git bisect reset
```
**Automated Bisect:**
```bash
# Create test script
cat > test-bug.sh << 'EOF'
#!/bin/bash
# Return 0 if good, non-zero if bad
npm test -- --grep "specific test"
EOF
chmod +x test-bug.sh
# Run automated bisect
git bisect start
git bisect bad HEAD
git bisect good v1.0.0
git bisect run ./test-bug.sh
# Git will find the bad commit automatically
git bisect reset
```
**Bisect with Skip:**
```bash
# If commit can't be tested (won't build)
git bisect skip
# Skip range of commits
git bisect skip abc123..def456
```
**Bisect Log and Replay:**
```bash
# Save bisect session
git bisect log > bisect.log
# Replay session
git bisect replay bisect.log
```
## 4. Git Rerere (Reuse Recorded Resolution)
**Enable Rerere:**
```bash
# Enable globally
git config --global rerere.enabled true
# Check status
git config --get rerere.enabled
```
**Using Rerere:**
```bash
# When you resolve a conflict, git records the resolution
git merge feature-branch
# Resolve conflicts...
git add .
git commit
# Next time same conflict occurs, git auto-applies resolution
git merge another-branch
# "Resolved 'file.txt' using previous resolution."
# If auto-resolution is wrong, forget it
git rerere forget path/to/file
```
**Rerere Management:**
```bash
# View recorded resolutions
ls .git/rr-cache/
# Clean old resolutions
git rerere gc
# Show diff of recorded resolution
git rerere diff
```
## 5. Git Reflog
**Basic Reflog:**
```bash
# Show reflog
git reflog
# Show reflog with dates
git reflog --date=relative
# Show reflog for specific ref
git reflog show feature-branch
# Output
# abc123 HEAD@{0}: commit: Latest commit
# def456 HEAD@{1}: checkout: moving from main to feature
# ghi789 HEAD@{2}: commit: Previous commit
```
**Recovery with Reflog:**
```bash
# Recover deleted branch
git reflog
# Find last commit of deleted branch: abc123
git checkout -b recovered-branch abc123
# Undo hard reset
git reflog
# Find state before reset: HEAD@{2}
git reset --hard HEAD@{2}
# Recover lost stash
git fsck --unreachable | grep commit
git show <commit-hash>
git stash apply <commit-hash>
# Recover from bad rebase
git reflog
# Find pre-rebase state: HEAD@{5}
git reset --hard HEAD@{5}
```
**Reflog Expiration:**
```bash
# Check expiration settings
git config --get gc.reflogexpire # Default: 90 days
git config --get gc.reflogexpireunreachable # Default: 30 days
# Extend reflog retention
git config --global gc.reflogexpire 180.days
```Related Skills
skill-creator-advanced-usage
Sub-skill of skill-creator: Advanced Usage.
git-advanced-9-monorepo-patterns
Sub-skill of git-advanced: 9. Monorepo Patterns.
git-advanced-7-git-aliases
Sub-skill of git-advanced: 7. Git Aliases (+1).
git-advanced-6-git-hooks
Sub-skill of git-advanced: 6. Git Hooks.
git-advanced-1-interactive-rebase
Sub-skill of git-advanced: 1. Interactive Rebase (+1).
git-advanced-1-complete-gitconfig
Sub-skill of git-advanced: 1. Complete .gitconfig (+2).
git-advanced-1-commit-history
Sub-skill of git-advanced: 1. Commit History (+2).
airflow-2-advanced-operators
Sub-skill of airflow: 2. Advanced Operators (+6).
devtools-git-advanced-workflows
Sub-skill of devtools: Git Advanced Workflows (+1).
python-pptx-2-advanced-text-formatting
Sub-skill of python-pptx: 2. Advanced Text Formatting.
python-docx-2-advanced-paragraph-formatting
Sub-skill of python-docx: 2. Advanced Paragraph Formatting.
openpyxl-2-advanced-cell-formatting
Sub-skill of openpyxl: 2. Advanced Cell Formatting.