# 解决rebase后丢掉子分支的merge commit的解决方法
1. 首先rebase前commit如下,有三个branch:master,test-rebase-main-branch, test-rebase-sub-branch
2. 经过如下操作:git rebase master test-rebase-main-branch --rebase-merges,git checkout master, git merge test-rebase-main-branch --no-ff,然后删除分支test-rebase-sub-branch, 分支图变为