Squash the first two commits in Git? [duplicate]

This question already has answers here: Combine the first two commits of a Git repository? (8 answers) Closed 7 years ago. With git rebase –interactive <commit> you can squash any number of commits together into a single one. That’s all great unless you want to squash commits into the initial commit. That seems impossible to … Read more

How to squash commits in git after they have been pushed?

This gives a good explanation of squashing multiple commits: http://git-scm.com/book/en/Git-Branching-Rebasing but it does not work for commits that have already been pushed. How do I squash the most recent few commits both in my local and remote repos? When I do git rebase -i origin/master~4 master, keep the first one as pick, set the other … Read more