]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-bisect.txt
Rename git-config-set to git-repo-config
[thirdparty/git.git] / Documentation / git-bisect.txt
CommitLineData
215a7ad1
JH
1git-bisect(1)
2=============
7fc9d69f
JH
3
4NAME
5----
215a7ad1 6git-bisect - Find the change that introduced a bug
7fc9d69f
JH
7
8
9SYNOPSIS
10--------
f85a4191
JH
11'git bisect' start
12'git bisect' bad <rev>
13'git bisect' good <rev>
14'git bisect' reset [<branch>]
8db9307c 15'git bisect' visualize
b595ed14
JH
16'git bisect' replay <logfile>
17'git bisect' log
7fc9d69f
JH
18
19DESCRIPTION
20-----------
f85a4191
JH
21This command uses 'git-rev-list --bisect' option to help drive
22the binary search process to find which change introduced a bug,
23given an old "good" commit object name and a later "bad" commit
24object name.
7fc9d69f 25
f85a4191 26The way you use it is:
7fc9d69f 27
f85a4191
JH
28------------------------------------------------
29git bisect start
30git bisect bad # Current version is bad
31git bisect good v2.6.13-rc2 # v2.6.13-rc2 was the last version
32 # tested that was good
33------------------------------------------------
7fc9d69f 34
f85a4191
JH
35When you give at least one bad and one good versions, it will
36bisect the revision tree and say something like:
37
38------------------------------------------------
39Bisecting: 675 revisions left to test after this
40------------------------------------------------
41
42and check out the state in the middle. Now, compile that kernel, and boot
43it. Now, let's say that this booted kernel works fine, then just do
44
45------------------------------------------------
46git bisect good # this one is good
47------------------------------------------------
48
49which will now say
50
51------------------------------------------------
52Bisecting: 337 revisions left to test after this
53------------------------------------------------
54
55and you continue along, compiling that one, testing it, and depending on
56whether it is good or bad, you say "git bisect good" or "git bisect bad",
57and ask for the next bisection.
58
59Until you have no more left, and you'll have been left with the first bad
60kernel rev in "refs/bisect/bad".
61
62Oh, and then after you want to reset to the original head, do a
63
64------------------------------------------------
65git bisect reset
66------------------------------------------------
67
68to get back to the master branch, instead of being in one of the bisection
69branches ("git bisect start" will do that for you too, actually: it will
70reset the bisection state, and before it does that it checks that you're
71not using some old bisection branch).
7fc9d69f 72
8db9307c
JH
73During the bisection process, you can say
74
75 git bisect visualize
76
77to see the currently remaining suspects in `gitk`.
78
f73ae1fc 79The good/bad input is logged, and `git bisect
b595ed14
JH
80log` shows what you have done so far. You can truncate its
81output somewhere and save it in a file, and run
82
83 git bisect replay that-file
84
85if you find later you made a mistake telling good/bad about a
86revision.
87
7fc9d69f
JH
88
89Author
90------
91Written by Linus Torvalds <torvalds@osdl.org>
92
93Documentation
df8baa42 94-------------
7fc9d69f
JH
95Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
96
97GIT
98---
a7154e91 99Part of the gitlink:git[7] suite
7fc9d69f 100