撤消 git 平分错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8594758/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 06:16:19  来源:igfitidea点击:

Undoing a git bisect mistake

gitgit-bisect

提问by Graham Perks

I'm doing a non-automated git bisect via command line. All is going well until I accidentally hit return on the wrong line in my command history, and rather than running the test, I run 'git bisect good' (or bad). Oops - I don't yet know if this commit should be marked good or bad, yet that's what I've done.

我正在通过命令行进行非自动化的 git bisect。一切都很顺利,直到我不小心在命令历史记录中的错误行上按回车,我没有运行测试,而是运行 'git bisect good'(或 bad)。糟糕 - 我还不知道这个提交应该被标记为好还是坏,但这就是我所做的。

Can I undo the 'git bisect good' command, or make git forget the result of it, and go back and run the test for that commit?

我可以撤消“git bisect good”命令,还是让 git 忘记它的结果,然后返回并运行该提交的测试?

回答by manojlds

From the git-bisect documentation:

git-bisect 文档

Bisect log and bisect replay

After having marked revisions as good or bad, issue the following command to show what has been done so far:

$ git bisect log

If you discover that you made a mistake in specifying the status of a revision, you can save the output of this command to a file, edit it to remove the incorrect entries, and then issue the following commands to return to a corrected state:

$ git bisect reset
$ git bisect replay that-file

对分日志和对分重放

将修订标记为好或坏后,发出以下命令以显示到目前为止已完成的操作:

$ git bisect log

如果您发现在指定修订状态时出错,您可以将此命令的输出保存到一个文件中,对其进行编辑以删除不正确的条目,然后发出以下命令以返回到更正状态:

$ git bisect reset
$ git bisect replay that-file

回答by Benjamin Bannier

You can output a record of what was done using

您可以输出使用的记录

$ git bisect log > bisect.log

Open that file in an editor and edit/remove the faulty line. Then you can replay it with

在编辑器中打开该文件并编辑/删除错误行。然后你可以重播它

$ git bisect replay bisect.log

This is documented in git help bisect.

这记录在git help bisect.