
git rebase -i
-
選取不變動的
commit -
編輯模式中,選取欲合併的版本
squash -
輸入新的 Commit Message
Example
在 dog 分支合併 commit

選取不變動版本
git rebase -i ac47f81
進入編輯模式

選取欲合併版本
cat2, cat3, cat4 合併至 cat1
dog2, dog3 合併至 dog1

輸入新的 Commit Message
修改合併後新的 Commit Message
範例中共合併至兩個 Commit,分別出現兩次 commit 修改,這裡只截取最後一次

Final
dog 分支上的 Commit 紀錄被合併了





近期评论