Why should I care About Git history?
Have you ever seen a git history like this?
messy-history.png
This log does not say too much about the changes. You can see the experiments done by the developer, bugs discovered and fixed along the way, and non-descriptive commit messages. Now, imagine reviewing a PR with these commits, it’s harder than it should be.
Also, consider a situation where you’re investigating a bug and checking the commit history. This history is full of noise, making it hard to pinpoint relevant changes.
When we develop, it’s normal to experiment, maybe we’re trying out a new library or exploring different approaches to solving a problem. But our back-and-forths during development don’t need to be preserved in the project’s history, right?
The first part of a cleaning history is to clean your branches, but what happens when you merge your changes with your colleague’s changes?