You merge, and the world breaks. You rebase, and it bends. But when your infrastructure is immutable, the story changes. Every deployment becomes a clean slate. Every change carries the full weight of intent. No hidden drift. No ghosts from the past.
Git rebase is a scalpel. It rewrites history, sharpens the narrative, and leaves no tangled merge trails. In code, it gives you a straight line. In immutable infrastructure, it gives you a history of truth — one commit at a time, a perfect sequence of deployable states. Combine the two, and you get a system that never lies.
With mutable infrastructure, replays are dangerous. Configurations drift. Environments rot. The same code can give you different results tomorrow than it did today. That's a silent failure. Immutable infrastructure kills that risk. Every build produces a new artifact. Every artifact is deployed and versioned. No tweaking in place. No patching by hand. No state that changes outside of your source control.
Now bring Git rebase into the game. Instead of piling messy merge commits into your infrastructure code, you refine history before it ever ships. Your main branch becomes a source of sequential truth — a direct, linear record of each deployment-ready build. When you point to commit abc123, you know exactly what’s inside, every time.