如何在交互式编辑器中中止git rebase [英] How to abort a git rebase in interactive editor
问题描述
当我做一个交互式的rebase时,比如
git rebase -i HEAD〜3
$ c
rebase交互式编辑器(在我的例子中为vim)打开,让我编辑提交rebase pick c843ea2将Vim列限制设置为80(OS X)
pick fc32eac为`pbcopy`(OS X)
添加Bash别名... 。
如果我现在决定放弃rebase并使用:q
无论如何,rebase都会启动。我在Windows上使用git版本 1.9.0.msysgit.0
。
当然,我可以全部删除挑选
这几行,但如果我重新设定较长的历史记录,这可能需要很多工作。有没有另一种方法?
如何退出rebase interactive editor(vim)并中止rebase?
解决方案如果您退出vim并显示错误代码,它会中止rebase。
要以错误代码退出,请执行
:cq
When I do an interactive rebase, e.g.
git rebase -i HEAD~3
the rebase interactive editor (vim in my case) opens to let me edit the commits to rebase
pick c843ea2 Set Vim column limit to 80 (OS X)
pick fc32eac Add Bash alias for `pbcopy` (OS X)
....
If I now decide that I want to abort the rebase and quit vim using :q
the rebase starts anyway. I'm using git version 1.9.0.msysgit.0
on windows.
Sure I can just delete all pick
lines, but it might be a lot to do if I rebase a longer history. Is there another way?
How can I quit the rebase interactive editor (vim) and abort the rebase?
解决方案 If you exit vim with an error code, it will abort the rebase.
To exit with an error code, do
:cq
这篇关于如何在交互式编辑器中中止git rebase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!