git absorb maps staged hunks to recent commits and writes fixup commits, similar to hg absorb. Optional rebase integrates fixes without manual fixup targeting.
Overview
git absorb helps developers keep atomic history when review feedback arrives as scattered line edits. After staging fixes, the tool inspects recent commits on the branch and tests whether each hunk commutes with candidate parents to decide where a fixup belongs.
By default it examines about the last ten commits unless a base ref is set. Hunks that match a commit spawn fixup! messages referencing that commit; hunks that commute with the entire stack stay staged with a warning. The --and-rebase flag can apply fixups immediately via autosquash semantics.
The implementation is a Rust CLI using bundled libgit2, with packages for common operating systems and cargo install from source. Documentation covers stack sizing, reset recovery via reflog, and manual pages for configuration.
Teams doing frequent interactive rebases use absorb to avoid hand-picking SHAs for git commit --fixup when addressing review comments on feature branches.
Key features
- Staged hunk to commit mapping
- Automatic fixup commits
- Optional autosquash rebase
- Commutation-based matching
- Configurable commit stack
- Explicit base commit
- Cross-platform binaries
- reflog-friendly recovery
Use cases
- Applying code review fixes
- Maintaining atomic git history
- Avoiding manual fixup SHAs
- Stacked branch workflows