← all posts post Jul 14, 2026 · 5 min read

🪓 Git History is the Underdog Hero Your Rebase Deserves

#git#automation#devops#testing#ai

The problem we all love to hate

If you’ve been living in a repo for more than a week you know the feeling: a stray typo in a commit message, a forgotten console.log, or a half‑baked feature that finally needs to be split into two logical pieces. The usual response? A nervous glance at git rebase -i, a few deep breaths, and a prayer that you don’t accidentally drop a commit and break the whole branch tree. It’s the same ritual that makes many of us flirt with alternatives like jj – the fancy, “Git‑ish” tool that promises painless rewrites.

But here’s the kicker: you don’t have to abandon your beloved Git to get most of the magic. Enter git history, the experimental command that landed in Git 2.54/2.55. It’s a tiny, core‑only addition that packs three sub‑commands—fixup, reword, and split—that let you edit the past without the usual rebase headaches.

Fixup, Reword, Split – What the hype is actually about

  • git history fixup <commit> – Stage a change, point at the old commit, and watch Git fold the fix in, then automatically rebuild every descendant commit on every local branch that contains it.
  • git history reword <commit> – Open your editor on the chosen commit’s message, edit, and the whole stack is re‑hashed with a fresh hash. No working‑tree changes, just a clean graph rewrite.
  • git history split <commit> – The interactive hunk picker that lets you break a monolithic commit into two logical ones, all without the gymnastics of git rebase -i and add -p.

What’s surprising is the atomicity: the command refuses to run if a conflict would arise, meaning you never end up with a half‑rebased tree. That’s a big win for CI pipelines that can’t afford a “rebase in progress” state.

Why this matters for automation and testing

In my day‑to‑day SDET life, the biggest source of flaky pipelines is a stray commit that silently changes the shape of the repo. A git pull in a test container can start failing because the commit hash the test suite expects has shifted. With git history fixup, the fix propagates automatically to every branch that descends from the altered commit. No more manual git rebase --update-refs gymnastics, no more “my feature branch is stuck at an ancient hash”.

What’s more, the command works without any external tools. That matters when you’re building a Docker image that runs git clone and then fires off a series of automated sanity checks. Adding a new binary like jj would increase the surface area for security scans and version drift. Keeping everything inside the official Git binary simplifies supply‑chain security—something we’re all paranoid about after the recent Codex sub‑agent prompt encryption saga (see the Hacker News link about Codex encrypting prompts). If the tool you rely on starts encrypting its own internals, you’re forced to audit more code. With git history you stay in the trusted, audited Git core.

A quick practical takeaway

When you need to retroactively edit a commit, reach for git history first. 1. Stage the fix (or nothing for reword). 2. Run git history fixup <sha> or git history reword <sha>. 3. Let Git rewrite the graph and move all local branches automatically. That’s it. Your CI stays green, your reviewers see a clean history, and you avoid the “oops‑I‑rebased‑the‑wrong‑branch” nightmare.

The bigger picture – why the Git world is still relevant

You might wonder whether this is just another niche feature. I say no, because the same mindset of “do the right thing in the repo, not in a separate tool” is echoing across other domains:

  • Lithium recovery in Japan – Researchers just announced a method to pull 90 % of lithium from used EV batteries. The key is integrated processes: a single loop that extracts, refines, and re‑feeds the material without a separate, clunky refinery stage. Git history does the same for commit histories: one integrated loop instead of a chain of external scripts.
  • Building iOS apps without Xcode – A new workflow lets you compile and ship Mac/iOS binaries from the command line, shaving off the heavy Xcode UI. It’s a reminder that the tooling we cling to (Xcode, GUI‑only workflows) is often a convenience, not a necessity. git history is the Git equivalent: a command‑line, core‑only way to perform what many thought required a heavyweight UI or third‑party binary.

Both stories reinforce the idea that we should favor first‑class, in‑process capabilities. If you can achieve a goal without pulling in a new dependency, you reduce complexity, improve reproducibility, and keep your CI/CD pipelines lean.

A note on the missing piece: first‑class conflicts

The biggest limitation of git history right now is its inability to carry a conflicted state through the rewrite. jj treats conflicts as first‑class citizens, allowing you to pause, resolve, and continue. Git’s design deliberately refuses to start a rewrite that would generate a conflict. It’s a safe default, but in large monorepos it can feel restrictive.

The docs hint that this could change if Git ever learns “first‑class conflicts”. I’m genuinely excited to see if the community pushes that forward, because it would combine the safety of git history with the flexibility of jj. Until then, I’ll keep my “danger zone” rewrites out of the nightly pipeline and reserve jj for those rare, massive refactors where I’m willing to babysit the conflict resolution.

Bottom line

git history is a modest but powerful addition that solves a real pain point for anyone who lives with long‑running feature branches, multiple parallel streams, and flaky CI caused by hidden rewrites. It lets you fix, reword, and split old commits atomically, propagates changes across all descendant branches, and does so without any extra binary.

If you’re still on the fence, try it on a sandbox repo this week. Stage a tiny typo, run git history fixup <sha>, and watch the magic happen. You’ll end the day with a cleaner history, a happier CI, and one less excuse to install a mysterious tool that nobody else can reproduce.

Happy hacking, and may your histories stay sane.

📡 Enjoyed this?

Subscribe to get worldwide tech signals with my take, straight to your inbox.