1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
10 .de Sp \" Vertical space (when we can't use .PP)
16 .ie \\n(.$>=3 .ne \\$3
20 .TH "GIT-BISECT" 1 "" "" ""
22 git-bisect \- Find the change that introduced a bug
26 git bisect <subcommand> <options>
31 The command takes various subcommands, and different options depending on the subcommand:
34 git bisect start [<paths>\&.\&.\&.]
37 git bisect reset [<branch>]
39 git bisect replay <logfile>
44 This command uses git\-rev\-list \-\-bisect option to help drive the binary search process to find which change introduced a bug, given an old "good" commit object name and a later "bad" commit object name\&.
47 The way you use it is:
51 $ git bisect bad # Current version is bad
52 $ git bisect good v2\&.6\&.13\-rc2 # v2\&.6\&.13\-rc2 was the last version
53 # tested that was good
55 When you give at least one bad and one good versions, it will bisect the revision tree and say something like:
58 Bisecting: 675 revisions left to test after this
60 and check out the state in the middle\&. Now, compile that kernel, and boot it\&. Now, let's say that this booted kernel works fine, then just do
63 $ git bisect good # this one is good
68 Bisecting: 337 revisions left to test after this
70 and you continue along, compiling that one, testing it, and depending on whether it is good or bad, you say "git bisect good" or "git bisect bad", and ask for the next bisection\&.
73 Until you have no more left, and you'll have been left with the first bad kernel rev in "refs/bisect/bad"\&.
76 Oh, and then after you want to reset to the original head, do a
81 to get back to the master branch, instead of being in one of the bisection branches ("git bisect start" will do that for you too, actually: it will reset the bisection state, and before it does that it checks that you're not using some old bisection branch)\&.
84 During the bisection process, you can say
87 $ git bisect visualize
89 to see the currently remaining suspects in gitk\&.
92 The good/bad input is logged, and git bisect log shows what you have done so far\&. You can truncate its output somewhere and save it in a file, and run
95 $ git bisect replay that\-file
97 if you find later you made a mistake telling good/bad about a revision\&.
100 If in a middle of bisect session, you know what the bisect suggested to try next is not a good one to test (e\&.g\&. the change the commit introduces is known not to work in your environment and you know it does not have anything to do with the bug you are chasing), you may want to find a near\-by commit and try that instead\&. It goes something like this:
103 $ git bisect good/bad # previous round was good/bad\&.
104 Bisecting: 337 revisions left to test after this
105 $ git bisect visualize # oops, that is uninteresting\&.
106 $ git reset \-\-hard HEAD~3 # try 3 revs before what
109 Then compile and test the one you chose to try\&. After that, tell bisect what the result was as usual\&.
112 You can further cut down the number of trials if you know what part of the tree is involved in the problem you are tracking down, by giving paths parameters when you say bisect start, like this:
115 $ git bisect start arch/i386 include/asm\-i386
119 Written by Linus Torvalds <torvalds@osdl\&.org>
124 Documentation by Junio C Hamano and the git\-list <git@vger\&.kernel\&.org>\&.
129 Part of the \fBgit\fR(7) suite