How to resume a git bisect
Asked Answered
T

2

9

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?

Throstle answered 20/12, 2017 at 12:51 Comment(1)
I would guess that the git bisect bad didn't apply so you just have to run it again. In case you're not sure, take a look at git bisect log (git-scm.com/docs/git-bisect#_bisect_log_and_bisect_replay)Autorotation
S
13

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.

Scald answered 20/12, 2017 at 18:7 Comment(0)
D
2

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>

Deaden answered 17/2, 2018 at 13:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.