The git history command

367 points · 243 comments on HN · read original →

Points and comments are a snapshot, not live.

Git's experimental `git history` command offers safer alternatives to interactive rebase for common rewrite operations.

The post argues that `git history`, available in Git 2.54 and 2.55, provides three atomic subcommands-`fixup`, `reword`, and `split`-that fold changes into old commits without leaving the tree in a broken state. Unlike `git rebase --update-refs`, it rewrites all local branches descended from the target. `fixup` stages a fix and auto-rebases all branches; `reword` edits commit messages; `split` interactively divides a commit. A key limitation: it refuses operations that would produce conflicts. The author notes this is less powerful than `jj` but is built into core Git.

What commenters are saying

Commenters are split. Some see `git history` as a welcome simplification of common rebase tasks, particularly for juniors. Others argue that interactive rebase is already fine, noting `git rebase --abort` and `git reflog` provide safety, and that conflict fear stems from poor code comprehension, not Git's interface. A pro-tip: use `git reflog <branchname>` (not HEAD) to track rebase history, or manually save a branch with `before-rebase/` prefix. One commenter points out that `git log -1` works without `-n`.