2015-10-16 126 views
4

這是我的假樹:如何在rebase期間壓扁(與下一個合併)提交?

A---B---C---D (master) 

我開始變基的互動從根:git rebase --root -i併爲所有提交設置edit命令。下面是例子:

e b83fa60 Initial content (A) 
e 9a82ddf Update license information (B) 
e fa8cb80 Rewrite readme (C) 
e 0525f07 Update email address (D) 

現在,我已經在B處重訂期間停止:

A---B---C---D (master) 
    ^

在這一點上我想「合併」或「擠壓」 B與下一個C提交。我該怎麼做?

+1

爲什麼要在編輯提交消息時合併或擠壓提交? – sfandler

+0

因爲我已經開始從根開始約30次提交,我不想重新啓動該進程。無論如何,我只是想知道我能否做到這一點。 –

回答

5

git rebase --continue將停止您在下一個e承諾這是C,然後git reset HEAD^ && git add . && git commit --amend將擠壓與先前(B)的當前(C)。儘管我個人簡單地繼續改版並重做,並將C標記爲sf - 更簡單快捷。