Git squash commits in the middle of a branch
I want to squash several commits together in the middle of a branch without modifying the commits before and after. I have : A -- B -- C -- D -- E -- F -- G | | master dev origin/master I want to squash that into A -- H -- E -- F -- G | | master dev origin/master Where H is equivalent to B -- C -- D . And I want to be able to specify the commit message of H . A is the last commit that has been pushed so all commits after that can be rewritten without messing up the server. The idea is to clean up the history before I fast forward master . How can I do that ? PS: Note that in my case I actually