![](/img/trans.png)
[英]How to Git rebase interractively squash few commits before merge commit
[英]How to squash (merge with next one) commit during rebase?
這是我的偽樹:
A---B---C---D (master)
我從根開始交互式rebase: git rebase --root -i
和set edit
命令用於所有提交。 這是一個例子:
e b83fa60 Initial content (A)
e 9a82ddf Update license information (B)
e fa8cb80 Rewrite readme (C)
e 0525f07 Update email address (D)
現在我在rebase期間停在了B:
A---B---C---D (master)
^
此時我想用下一個C提交“合並”或“壓縮”B。 我該怎么做?
git rebase --continue
會阻止你在下次e
承諾是C,那么git reset HEAD^ && git add . && git commit --amend
git reset HEAD^ && git add . && git commit --amend
將使用前一個(B) git reset HEAD^ && git add . && git commit --amend
當前(C)。 雖然我個人只是繼續使用標記C為s
或f
再次重新設定和重做 - 更簡單,更快捷。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.