Stop squashing your commits. You're squashing your AI too
2 jannesblobel 5 8/26/2025, 10:22:09 AM
Everyone keeps saying “keep your Git history clean.” Squash, rebase, linearize. It looks neat in the git log.
But here’s the thing: in 2025 our biggest collaborators aren’t just humans, they’re AI tools. And those tools need the messy history: the failed attempts, the typos, the bad refactors. That’s the context they learn from.
When we squash everything into a perfect history, we’re deleting the very breadcrumbs that could help an agent explain a bug, trace a regression, or warn us we’re about to repeat an old mistake.
“Clean history” makes reviewers happy today. But it’s technical debt for tomorrow’s AI-assisted development
How exactly would it help to have a commit that introduces a problem and then another one that fixes it? How does leaving in a bad refactor, failed attempt, or typo help the AI tool with anything?
https://www.augmentcode.com/blog/announcing-context-lineage
Version history is only interesting if you’re doing archeology. And I would prefer seeing a squashed commit that introduce a complete change instead of going back and forth to get the complete picture (anyone with such messy history will introduce unrelated changes too).
As for failure, put that in some tracker, with an “abandoned” status.
Sure, that makes sense, if you’re just interested in the internals, the history doesn’t matter. I get that.
But what do you think about the idea of keeping two views of history? One that’s clean and human-readable, and another that preserves all the detailed commits. With the right filters, you could switch between the simple view and the full story.
EDIT: By the way, I just want to discuss a theory/some thoughts here. There are always pros and cons, and perhaps my text is a little too harshly worded.
One thing about code archeology is that you’re not really interested in the diff itself, but the commit description. Which is why an issue tracker can fit that role.