The Git history command deserves more attention
6 hours ago
- #workflow
- #version-control
- #git
- Git history is a new experimental feature in Git that introduces three subcommands: fixup, reword, and split.
- fixup allows staging changes and folding them into an old commit, then automatically rebasing all branches that contain that commit.
- reword updates the commit message of an old commit and automatically rebases everything on top without touching the working tree.
- split divides a single commit into two by interactively selecting hunks, rebuilding the stack on top.
- All three commands are atomic and avoid leaving the tree in a half-broken state by refusing operations that could cause conflicts.
- Unlike jj, git history does not handle conflicts as first-class yet, but the documentation suggests this may change in the future.
- git history offers many benefits of jj without requiring a full workflow switch, and it's part of the core Git distribution.