Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run git bisect only on commits that changed a certain file? [duplicate]

Tags:

git

git-bisect

I have a bug that have been introduced a long time ago, and testing for it is painful. However, I strongly suspect that changes which introduced the bug happened in one particular source code file.

Can I run git bisect on a sub-set of commits that changed that one file?

like image 325
Max Yankov Avatar asked Sep 13 '13 12:09

Max Yankov


1 Answers

Yes, you can. In the manpage, you find this line:

git bisect start [--term-{old,good}=<term> --term-{new,bad}=<term>]
      [--no-checkout] [<bad> [<good>...]] [--] [<paths>...]

so after --, you put the paths of the files or directories.

For example:

git bisect start -- arch/i386 include/asm-i386
like image 143
silvio Avatar answered Nov 08 '22 06:11

silvio