tummychow /git-absorb

git commit --fixup, but automatic

★ 5,763⑂ 114👁 18⑃ 103● 115▤ 22
RustBSD-3-ClauseCreated 2018-02-15crates.io/crates/git-absorb
Download: 0.9.00.9.0 ↓0.9.02026-02-14
+1
Daily
5,763
stars
114
forks
18
watchers
103
prs
115
issues
22
releases

README

git absorb

This is a port of Facebook's hg absorb, which I first read about on mozilla.dev.version-control:

  Facebook demoed hg absorb which is probably the coolest workflow enhancement I've seen to version control in years. Essentially, when your working directory has uncommitted changes on top of draft changesets, you can run hg absorb and the uncommitted modifications are automagically folded ("absorbed") into the appropriate draft ancestor changesets. This is essentially doing hg histedit + "roll" actions without having to make a commit or manually make history modification rules. The command essentially looks at the lines that were modified, finds a changeset modifying those lines, and amends that changeset to include your uncommitted changes. If the changes can't be made without conflicts, they remain uncommitted. This workflow is insanely useful for things like applying review feedback. You just make file changes, run hg absorb and the mapping of changes to commits sorts itself out. It is magical. 

 Elevator Pitch

You have a feature branch with a few commits. Your teammate reviewed the branch and pointed out a few bugs. You have fixes for the bugs, but you don't want to shove them all into an opaque commit that says fixes, because you believe in atomic commits. Instead of manually finding commit SHAs for git commit --fixup, or running a manual interactive rebase, do this:


git add $FILES_YOU_FIXED
git absorb --and-rebase


git absorb will automatically identify which commits are safe to modify, and which staged changes belong to each of those commits. It will then write fixup! commits for each of those changes.

With the --and-rebase flag, these fixup commits will be automatically integrated into the corresponding ones. Alternatively, you can check its output manually if you don't trust it, and then fold the fixups into your feature branch with git's built-in autosquash functionality:


git add $FILES_YOU_FIXED
git absorb
git log  check the auto-generated fixup commits
git rebase -i --autosquash master


 Installing

The easiest way to install git absorb is to download an artifact from the latest tagged release. Artifacts are available for Windows, MacOS, and Linux (built on Ubuntu with statically linked libgit2). If you need a commit that hasn't been released yet, check the latest CI artifact or file an issue.

Alternatively, git absorb is available in the following system package managers:


    


| Repository                  | Command                                      |
| --------------------------- | -------------------------------------------- |
| Arch Linux                  | pacman -S git-absorb                       |
| Debian                      | apt install git-absorb                     |
| DPorts                      | pkg install git-absorb                     |
| Fedora                      | dnf install git-absorb                     |
| Flox                        | flox install git-absorb                    |

Top issues

Latest release

0.9.0 0.9.0 2026-02-14
What's Changed
 Other Changes
 and_rebase: use workdir() rather than .path().parent() by @Pear0 in https://github.com/tummychow/git-absorb/pull/191
 Extract structs that encode announcements to users by @blairconrad in https://github.com/tummychow/git-absorb/pull/194
 Add flag to create squash commits by @blairconrad in https://github.com/tummychow/git-absorb/pull/195
 Make output more human-readable by @blairconrad in https://github.com/tummychow/git-absorb/pull/200
 ci: add darwin arm64 (aarch64-apple-darwin) build target by @radiosilence in https://github.com/tummychow/git-absorb/pull/203
 

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON