在git rebase -i HEAD~2
待完成文字我有以下几点:混帐:“不是‘南瓜’之前没有能提交”错误而变基
pick 56bcce7 Closes #2774
pick e43ceba Lint.py: Replace deprecated link
# Rebase 684f917..e43ceba onto 684f917 (2 command(s))
#
# 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
# d, drop = remove commit
#
# 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
现在,当我尝试压扁第一个(56bcce7
)和前第一加“S”挑第二个,我得到以下错误:
Cannot 'squash' without a previous commit
有人能解释我这是什么意思?我该怎么办呢?
我想压扁第一次提交(56bcce7
)和“选择并改写”第二(e43ceba
)提交
如果你真的想挤压,把HEAD〜2改成HEAD〜3。 – ElpieKay
并且可能使用--root,如果HEAD〜2是您的第一次提交:https://stackoverflow.com/a/598788/2444812 – wirap
要删除绒毛,您只需要粘贴示例的前4行。 – wirap