如何在交互式编辑期间从vim中终止git rebase [英] How to abort a git rebase from inside vim during interactive editing

查看:270
本文介绍了如何在交互式编辑期间从vim中终止git rebase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我进行交互式变基时,例如

When I do an interactive rebase, e.g.

git rebase -i HEAD~3

rebase交互式编辑器(在我的情况下为vim)打开,让我编辑要重新设置的提交

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)
....

如果我现在决定我想中止rebase并使用:q退出vim,则无论如何都要开始rebase.我在Windows上使用git版本1.9.0.msysgit.0.

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.

当然,我可以删除所有pick行,但是如果我根据较长的历史记录来做的话,可能会做很多事情.还有另一种方法吗?

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?

如何退出rebase交互式编辑器(vim)并中止rebase?

How can I quit the rebase interactive editor (vim) and abort the rebase?

推荐答案

如果使用错误代码退出编辑器,则重新定位将中止.

If you exit the editor with an error code, the rebase will be aborted.

要在vim上退出并显示错误代码,请

To exit with an error code on vim, do

:cq

请参见此处和vimdoc

See here and vimdoc here.

这篇关于如何在交互式编辑期间从vim中终止git rebase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆