在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