Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resume a git bisect

Suppose that I'm going through a git bisect, and after running a git bisect bad command, my git bisect gets interrupted like so:

$ git bisect bad
Bisecting: 0 revisions left to test after this (roughly 1 step)
error: Your local changes to the following files would be overwritten by checkout:
    app/app.iml
Please commit your changes or stash them before you switch branches.
Aborting

I can simply eliminate this file by running:

git checkout -- app/app.iml

which will make my git state clean again.. but I'm not sure how to proceed thereafter (ie to let git bisect continue bisecting).. I believe I've done a git bisect bad before and it kind of skipped a step or did something i didn't expect it to. I simply want to resume my git bisect operation.. how to do that?

like image 996
abbood Avatar asked Jan 04 '23 01:01

abbood


2 Answers

The last thing git bisect good or git bisect bad does is run git checkout on the next commit to test. It's this git checkout itself that failed.

The revision that git bisect was attempting to git checkout is stored in the special ref BISECT_EXPECTED_REV. You can clean up whatever failed and run git checkout BISECT_EXPECTED_REV to check it out. You will need to resume any automated or manual testing at this point.

like image 184
torek Avatar answered Jan 05 '23 15:01

torek


You can always write git bisect log which will output all the bisect operations done so far.

If you save this output, you can later replay it using git bisect replay <logfile>

like image 24
user1708860 Avatar answered Jan 05 '23 14:01

user1708860