explaingit

tummychow/git-absorb

5,544RustAudience · developerComplexity · 2/5Setup · easy

TLDR

A command-line Git tool that automatically figures out which previous commit your staged changes belong to and creates fixup commits for you, saving you from manual rebase bookkeeping.

Mindmap

mindmap
  root((git-absorb))
    What it does
      Auto-detects target commit
      Creates fixup commits
      Runs autosquash rebase
    How it works
      Analyzes staged changes
      Checks patch independence
      Labels fixup commits
    Tech Stack
      Rust
      Git integration
      Prebuilt binaries
    Use Cases
      Fix earlier commits
      Clean up branch history
      Automate rebase workflow
    Audience
      Developers
      Open source contributors
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Automatically fold bug fixes into the correct earlier commit without manually running interactive rebase.

USE CASE 2

Clean up a branch before a pull request by absorbing staged changes into their proper commits in one step.

USE CASE 3

Use --and-rebase to stage fixes and have git-absorb squash everything into history automatically.

USE CASE 4

Maintain a tidy commit history while iterating on code reviews without manual rebase bookkeeping.

Tech stack

RustGit

Getting it running

Difficulty · easy Time to first run · 5min

Requires an existing Git repo with multiple commits, installable in one command via Homebrew or Linux package manager.

No explicit license information provided in the explanation.

In plain English

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.

Copy-paste prompts

Prompt 1
I have staged changes in Git that fix a bug from a previous commit on my branch. Show me how to use git-absorb to automatically create a fixup commit targeting the right commit.
Prompt 2
How do I install git-absorb on macOS with Homebrew and integrate it into my daily Git workflow?
Prompt 3
Explain how git-absorb figures out which commit a staged change belongs to using patch order independence.
Prompt 4
Write the exact git commands to use git-absorb --and-rebase so my staged fixes get folded into history in one step.
Prompt 5
What is the difference between git absorb followed by git rebase --autosquash versus git absorb --and-rebase?
Open on GitHub → Explain another repo

← tummychow on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.