我如何停止 git bisect?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23156415/
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
How do I stop git bisect?
提问by kodu
I tried git bisect a while ago and it helped me well, but apparently I didn't stop it. When I do git status I still get:
不久前我尝试了 git bisect,它对我帮助很大,但显然我并没有阻止它。当我执行 git status 时,我仍然得到:
You are currently bisecting.
(use "git bisect reset" to get back to the original branch)
I don't really want to reset to anywhere, I just want to stop bisecting. It's really just a matter of getting rid of this message.
我真的不想重置到任何地方,我只想停止平分。这真的只是摆脱这个消息的问题。
回答by Leigh
git bisect reset
is how you stop bisecting. By default it will reset the HEAD to where it was before you started, although you can also use git bisect reset <commit>
to go to that one instead.
git bisect reset
是你如何停止平分。默认情况下,它会将 HEAD 重置为您开始之前的位置,但您也可以使用git bisect reset <commit>
转到那个位置。
If you just want to stop bisecting without changing the commit, from the documentation, git bisect reset HEAD
would do what you want.
如果您只想在不更改提交的情况下停止平分,那么从文档中git bisect reset HEAD
可以做您想做的事情。
Bisect reset
After a bisect session, to clean up the bisection state and return to the original HEAD (i.e., to quit bisecting), issue the following command:
$ git bisect reset
By default, this will return your tree to the commit that was checked out before git bisect start. (A new git bisect start will also do that, as it cleans up the old bisection state.)
With an optional argument, you can return to a different commit instead:
$ git bisect reset <commit>
For example,
git bisect reset HEAD
will leave you on the current bisection commit and avoid switching commits at all, while git bisect reset bisect/bad will check out the first bad revision.
对分重置
在二等分会话之后,要清除二等分状态并返回到原始 HEAD(即退出二等分),请发出以下命令:
$ git bisect reset
默认情况下,这会将您的树返回到在 git bisect 启动之前签出的提交。(一个新的 git bisect start 也会这样做,因为它会清理旧的二分状态。)
使用可选参数,您可以改为返回不同的提交:
$ git bisect reset <commit>
例如,
git bisect reset HEAD
会让你留在当前的二分提交上并完全避免切换提交,而 git bisect reset bisect/bad 将检查第一个错误的修订。
回答by ginna
Adding to @leigh's answer, you can also do git checkout <branchname>
(eg, git checkout dev
) to quit the bisect and get to the commit at the HEAD of that branch.
添加到@leigh 的答案中,您还可以执行git checkout <branchname>
(例如,git checkout dev
)退出二等分并在该分支的 HEAD 处提交。