4

假设我正在经历一个 git bisect,并且在运行一个git bisect bad命令后,我的 git bisect 会像这样被中断:

$ 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

我可以通过运行简单地消除此文件:

git checkout -- app/app.iml

这将使我的 git 状态再次清洁.. 但我不知道此后如何继续(即让 git bisect 继续平分).. 我相信我之前做过一个git bisect bad,它有点跳过了一步或做了什么我没想到会。我只是想恢复我的 git bisect 操作.. 怎么做?

4

2 回答 2

8

最后一件事git bisect goodgit bisect bad做的是git checkout在下一次提交测试时运行。这git checkout本身就是失败的。

git bisect试图修改的版本git checkout存储在特殊的 refBISECT_EXPECTED_REV中。您可以清理任何失败的内容并运行git checkout BISECT_EXPECTED_REV以检查它。此时您将需要恢复任何自动或手动测试。

于 2017-12-20T18:07:10.770 回答
1

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>

于 2018-02-17T13:59:13.157 回答