Is there a way to squash commits that have a merge commit? I am able to squash when there is not any merge commits but I don't know how to do it when there is one.
Like these two commits.
Is there a way to squash commits that have a merge commit? I am able to squash when there is not any merge commits but I don't know how to do it when there is one.
Like these two commits.
Copyright © 2021 Jogjafile Inc.
Here I've built a graph like yours before the merge:
Now I merge master into feature:
Well, if I want to squash feature down to just one commit and erase the merge commit, then I should not have merged like that. I should have done a squash merge! However, all is not lost. I can just reset soft back to f1aeb9a and make a new commit:
That gives this:
Now "new commit" contains everything that was done on feature including the results of the merge from master. But of course we have lost the merge commit.