Skip to content
Skills Library
Programming · Automation

git-bisect

/git-bisect

Find the exact commit that introduced a regression by driving git bisect with an automated pass/fail script. Use when a behavior worked in an older build and you need the first bad commit out of hundreds, not a guess.

Repository
AI-SKILLS ↗
Licence
MIT
Last repository change
05.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Find the exact commit that introduced a regression by driving git bisect with an automated pass/fail script. Use when a behavior worked in an older build and you need the first bad commit out of hundreds, not a guess.

Original author description

Find the exact commit that introduced a regression by driving git bisect with an automated pass/fail script. Use when a behavior worked in an older build and you need the first bad commit out of hundreds, not a guess.

How it works

  1. Method
  2. Checks
  3. Boundaries
Original SKILL.md headings · 46 lines, 398 words
SKILL.md preview
---
name: git-bisect
description: Find the exact commit that introduced a regression by driving git bisect with an automated pass/fail script. Use when a behavior worked in an older build and you need the first bad commit out of hundreds, not a guess.
---

# git bisect

When a regression hides somewhere in three hundred commits, reading diffs is
hopeless and blaming the obvious file is usually wrong. `git bisect` runs a
binary search over history and, paired with a pass/fail command, checks out and
tests each midpoint for you. You supply one good commit, one bad commit, and a
script that exits 0 or non-zero.

## Method

1. **Confirm a known-good commit by hand.** Check out a tag or dated commit
   where the behavior worked and verify it yourself. A wrong "good" anchor
   sends the whole search into the wrong half and hands you a false culprit.
2. **Open the session.** Run `git bisect start`, then `git bisect bad` on the
   broken commit (often `HEAD`) and `git bisect good <sha>` on the confirmed
   one. Git checks out the midpoint and prints how many steps remain.
3. **Write a test that exits 0 for good and non-zero for bad.** A one-liner is
   ideal: `pytest tests/test_x.py::test_y -q` or a tiny shell script. Make it
   trip on this specific regression, not on unrelated breakage along the way.
4. **Automate the walk with `git bisect run`.** Pass the command:
   `git bisect run ./check.sh`. Git tests each midpoint unattended and names the
   first bad commit in about log2(N) steps, roughly nine for five hundred
   commits.
5. **Exit 125 for commits you cannot test.** If a midpoint fails to build for an
   unrelated reason, have the script `exit 125` so git skips it instead of
   scoring it good or bad and corrupting the result.
6. **Read the first-bad diff, not just its hash.** Git names the commit; you
   still owe the mechanism. A one-line change there is your lead, and sometimes
   it only exposed a latent fault planted much earlier.
7. **Close with `git bisect reset`.** Return to your branch and working state
   before you start the fix, or the next command runs against a detached HEAD
   and confuses everything downstream.

## Checks

- Did you verify the "good" commit by hand rather than assume it?
- Does the script isolate this regression and ignore noise from other failures?
- After the run, did `git bisect reset` restore your original branch?

## Boundaries

Bisect finds where behavior changed, not why it is wrong: a refactor can
surface a bug written long before it. For non-history spaces like data, config,
or a single uncommitted edit, use binary-search-debugging instead.

Versions

The database has no other skills named git-bisect.

Database snapshot: 13.11.2026 · package version 05be2fca3b41 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100git-bisect-hunting-regression-bugs
    Use this skill when pinpointing the exact commit introducing a software defect using automated binary search with git bisect.
  • 100bisect
    Bisect a ClickHouse regression using pre-built master binaries from CI. Use when the user wants to find the commit that introduced a bug.
  • 100bisect-anything
    Find the exact commit (or dependency version, config value, or input) that caused a regression by turning it into an automatic pass/fail check and running git bisect run in a separate worktree, then shrink the bad commit to the hunk that matters and explain it. Handles failing…
  • 100git-bisect-regression
    Find which commit introduced a bug or behavior change using `git bisect`. Use this whenever the user says something "used to work", "worked last week", "stopped working", "broke at some point", asks "which commit broke this", "when did this start", "find the regression" or "who…
  • 100git-bisect-ai
    AI-guided git bisect for finding the exact commit that introduced a bug or regression. Automates the binary search, interprets test results, and identifies the responsible code change with full context. Use when you know a bug exists now but didn't exist before, or when a…
  • 100git-bisect-assistant
    Automatically performs git bisect to identify the first bad commit that introduced a bug or failure. Use when debugging regressions, tracking down when a test started failing, or identifying which commit broke functionality. Handles flaky tests with retry logic and provides…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.