Automatically fold bug fixes into the correct earlier commit without manually running interactive rebase.
Clean up a branch before a pull request by absorbing staged changes into their proper commits in one step.
Use --and-rebase to stage fixes and have git-absorb squash everything into history automatically.
Maintain a tidy commit history while iterating on code reviews without manual rebase bookkeeping.
Requires an existing Git repo with multiple commits, installable in one command via Homebrew or Linux package manager.
git-absorb is a command-line tool that extends Git with an automatic way to fold uncommitted changes into the right previous commits. When you are working on a branch with several commits and need to fix something from an earlier commit, the usual approach is to figure out which commit introduced the relevant lines, create a fixup commit manually, and then run an interactive rebase to merge everything together. git-absorb automates the first two steps. You stage your fixes with git add as normal, then run git absorb. The tool looks at your staged changes, examines the recent commits in your branch, and figures out which commit each change logically belongs to. It creates fixup commits labeled with the target commit's message. You can then let Git's built-in autosquash feature fold them in, or use the --and-rebase flag to do everything in one step. Under the hood, the tool checks whether two patches can be applied in either order without changing the result. If a staged change and a commit are order-independent (they touch different lines), the change could belong to an older commit. When it finds a commit that conflicts with a staged change, it treats that commit as the right parent for the fix. The tool is written in Rust and available as a prebuilt binary for Windows, macOS, and Linux. It is also packaged in most major Linux distribution repositories and in Homebrew for Mac, so installation is typically one command. It can also be compiled from source using Rust's package manager.
← tummychow on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.