Splitting a Git Commit Just Got Simple
A new command, `git history split`, lets you interactively split a commit by choosing which hunks go into each new commit, then editing the messages. This replaces the old, error-prone method of interactive rebasing and resetting, which is still the top answer on Stack Overflow despite a better approach being available.
It couldn’t be simpler than that.
- opello
It seems strangely polarizing to refer to the "old and cumbersome" interactive rebase approach in contrast to "the right approach" using `git history` which is a brand new, experimental feature as of Git 2.54 from April 20, 2026, a few months ago.
I have split a lot of work with interactive rebasing. I'm excited to try `git history split` and to have learned about it here. But the stylistic flourish makes it seem like it's been a feature for years that people just haven't moved to instead of being something shiny and new to be excited about trying.
- roelschroeven
> P.S. The stack overflow question for splitting commits discusses the old and cumbersome approach. The 20th answer discusses the right approach but has a meagre 2 upvotes as of today, compared to 2656 for the older top answer with the cumbersome approach.
It now has 5 upvotes. A long way to go to 2656 but at least it's going in the right direction.
- diath
That's good to know, I'd usually go about it in a roundabout way: soft reset the commit then git add --patch to stage the hunks to split it into multiple commits.
- mateusz834
or use jj and stop worrying about git
jj split --interactive {ref}
- matheusmoreira
Today I learned about git history split. Thanks!!