git rebase --interactive HEAD~2 # we are going to squash c into b pick b76d157 b pick a931ac7 c # squash c into b pick b76d157 b s a931ac7 c # after that just edit the commit message # This is a combination of 2 commits. # The first commit's message is: b # This is the 2nd commit message: c