GIT-BISECT(1) Git Manual GIT-BISECT(1) (NAME) git-bisect - (SYNOPSIS) git bisect start [--term-(bad|new)= --term-(good|old)=] [--no-checkout] [--first-parent] [ [...]] [--] [...] git bisect (bad|new|) [] git bisect (good|old|) [...] git bisect terms [--term-(good|old) | --term-(bad|new)] git bisect skip [(|)...] git bisect next git bisect reset [] git bisect (visualize|view) git bisect replay git bisect log git bisect run [...] git bisect help (DESCRIPTION) . "" (bad) "" (good) . git bisect "" (good) "" (bad). . git bisect . "" (old) "" (new) "" (good) "" (bad) . << >> . bisect: start bad good v2.6.13-rc2 . bisect : $ git bisect start $ git bisect bad # $ git bisect good v2.6.13-rc2 # v2.6.13-rc2 git bisect : Bisecting: 675 revisions left to test after this (roughly 10 steps) . : $ git bisect good : $ git bisect bad git bisect : Bisecting: 337 revisions left to test after this (roughly 9 steps) : git bisect good git bisect bad . . refs/bisect/bad . bisect ( Bisect reset) bisect HEAD : git bisect reset git bisect start . ( git bisect start bisect ). : git bisect reset git bisect reset bisect/bad git bisect reset HEAD . (Alternate terms) "" (old) "" (new) . . . . "" (good) "" (bad) << >> << >> . "" (old) "" (new) "" "" . ( "good" "bad" "old" "new" ). git bisect "" "" . git bisect . "" (new) "" (old) . git bisect . "old" "new" "good" "bad" git bisect start : git bisect old [] git bisect new [...] . : git bisect terms git bisect terms --term-old git bisect terms --term-good git bisect terms --term-new git bisect terms --term-bad . "bad"/"good" "new"/"old" ( bisect reset start ): git bisect start --term-old --term-new (performance regression) : $ git bisect start --term-old fast --term-new slow : $ git bisect start --term-new fixed --term-old broken git bisect good git bisect bad git bisect git bisect . / bisect ( Bisect visualize/view) gitk ( view visualize ): $ git bisect visualize : DISPLAY X Window System . SESSIONNAME Cygwin . MSYSTEM Msys2 Git for Windows . SECURITYSESSIONID macOS . git log . -p --stat . $ git bisect visualize --stat bisect ( Bisect log bisect replay) : $ git bisect log : $ git bisect reset $ git bisect replay that-file bisect ( ) . : $ git bisect good/bad # (good) (bad) . Bisecting: 337 revisions left to test after this (roughly 9 steps) $ git bisect visualize # . $ git reset --hard HEAD~3 # # . bisect ( Bisect skip) : $ git bisect skip # (skip ) . (range) . : $ git bisect skip v2.5..v2.6 bisect v2.5 v2.6 . : $ git bisect skip v2.5 v2.5..v2.6 bisect v2.5 v2.6 ( ) . bisect ( Bisect next) . : $ git bisect next . bisect start pathspec bisect start : $ git bisect start -- arch/i386 include/asm-i386 bisect start bisect : $ git bisect start v2.6.20-rc6 v2.6.20-rc4 v2.6.20-rc1 -- # v2.6.20-rc6 # v2.6.20-rc4 v2.6.20-rc1 bisect ( Bisect run) : git bisect run [...] / (good/old) 0 / (bad/new) 1 127 ( ) 125 . bisect . exit(-1) 255 = $? ( exit(3) ) & 0377 . 125 . ( git bisect skip ). 125 126 127 POSIX (127 126 -- bisect run ). bisect ( s/#define DEBUG 0/#define DEBUG 1/ << bisect >>) . git bisect ( ) . git bisect run bisect . (OPTIONS) --no-checkout . BISECT_HEAD . . bare --no-checkout . --first-parent (merge commit) . . . (EXAMPLES) o v1.2 HEAD: $ git bisect start HEAD v1.2 -- # HEAD v1.2 $ git bisect run make # make $ git bisect reset # bisect o origin HEAD: $ git bisect start HEAD origin -- # HEAD origin $ git bisect run make test # make test $ git bisect reset # bisect o (test case) : $ cat ~/test.sh #!/bin/sh make || exit 125 # ~/check_test_case.sh # $ git bisect start HEAD HEAD~10 -- # $ git bisect run ~/test.sh $ git bisect reset # bisect test.sh . make . check_test_case.sh exit 0 exit 1 . test.sh check_test_case.sh bisect make . o (hot-fix): $ cat ~/test.sh #!/bin/sh # hot-fix # (build) if git merge --no-commit --no-ff hot-fix && make then # ~/check_test_case.sh status=$? else # status=125 fi # git reset --hard # exit $status hot-fix . ( hot-fix git cherry-pick git merge ). o : $ git bisect start HEAD HEAD~10 -- # $ git bisect run sh -c "make || exit 125; ~/check_test_case.sh" $ git bisect reset # bisect . o $ git bisect start HEAD [ ... ] --no-checkout $ git bisect run sh -c ' GOOD=$(git for-each-ref "--format=%(objectname)" refs/bisect/good-*) && git rev-list --objects BISECT_HEAD --not $GOOD >tmp.$$ && git pack-objects --stdout >/dev/null bisect git bisect run bisect/bad git pack-objects . o (fix) $ git bisect start $ git bisect new HEAD # (new) $ git bisect old HEAD~10 # (old) : $ git bisect start --term-old broken --term-new fixed $ git bisect fixed $ git bisect broken HEAD~10 git bisect git bisect help git bisect -h . (SEE ALSO) Fighting regressions with git bisect[1], git-blame(1). (GIT) git(1) (NOTES) 1. git bisect (Fighting regressions with git bisect) file:///usr/share/doc/git-doc/git-bisect-lk2009.html Git 2.55.0 2026-06-29 GIT-BISECT(1)