首先我想把一些提交合并成一个,
但是我做错了什么,
这次如何中止变基操作呢?因为如果我键入 'qa!' 退出 vim 编辑器,它也会执行变基操作。我不想这样。
首先我想把一些提交合并成一个,
但是我做错了什么,
这次如何中止变基操作呢?因为如果我键入 'qa!' 退出 vim 编辑器,它也会执行变基操作。我不想这样。
您并没有提供足够的关于rebase过程的信息,但基于您的截图,我猜测您已经完成了rebase编辑器的部分:
pick c843ea2 Set Vim column limit to 80 (OS X)
pick fc32eac Add Bash alias for `pbcopy` (OS X)
pick 7b9dbdd Add foo.txt for test
pick 5e45c82 Add doop.txt
# Rebase 320ed55..5e45c82 onto 320ed55
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out
假设你正在压缩一些提交,编辑器会提示以下内容:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
(master) $ git rebase -i head~4
Aborting commit due to empty commit message.
Could not apply 5e45c82a85818bd05e7fce3844ec720a8f99a418... Add doop.txt
(master|REBASE-i 4/4) $
现在只需使用--abort
标志来完成中止rebase:
(master|REBASE-i 4/4) $ git rebase --abort
(master) $