git-bisect - Linux


git-bisect assists in identifying the first potentially buggy commit in a Git repository. It’s particularly useful for tracking down the root of a regression or bug.


git bisect [<options>] start <bad> <good>


  • start: The starting point of the search (defaults to current branch tip)
  • bad: The commit known to be buggy
  • good: The commit known to be correct


  • –no-checkout: Don’t check out commits during bisection
  • –guess: Make an initial guess on the first bad commit
  • –skip: Skip checking specific commits
  • –skip-merge: Skip checking merge commits
  • –debug: Print additional debugging information
  • –all: Bisect all commits instead of just the interval


Basic usage:

git bisect start v1.0 v1.1

With options:

git bisect --no-checkout --skip merge-commit start v0.9 v1.0


Issue: Bisect gets stuck on a merge commit

Solution: Use --skip-merge option or manually bisect the merge commit.


With git-log:

git log --follow --format="  %h" | git bisect skip ^

With scripts:

git bisect start master release-1.0
while git bisect run ./test-script; do
  git bisect good

Related Commands

  • git-blame: Traces the origin of each line of code
  • git-tag: Marks commits with descriptive names for easier tracking
  • git bisect documentation