Git

Git: how to squash commits already pushed

A few days ago I was working on feature in a project, and after a lot of commits and pushes, I wanted to show to my colleagues my changes in a single commit.

3 minute read

A few days ago I was working on feature in a project, and after a lot of commits and pushes, I wanted to show to my colleagues my changes…. but I wanted to show them in a single commit. How could I join my 10 commits in a single one? I had heard about squashing commits with git before, so I was confident it would be easy to do. Googling a little, and reading some examples, I was confident about what I had to do: