git-absorb
git-absorb
Section titled “git-absorb”This DevContainer feature installs git-absorb, a tool that automatically absorbs staged changes into their logical commits. It’s like git commit --fixup but automatic.
Features
Section titled “Features”- Automatic fixup commits: Absorbs staged changes into existing commits automatically
- Multi-architecture support: Works on x86_64 and aarch64 Linux systems
- Latest version: Always installs the most recent release by default
- Git integration: Available as
git absorbsubcommand - Lightweight: Single binary installation with minimal dependencies
Add this feature to your devcontainer.json:
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
version | string | latest | Version of git-absorb to install (e.g., “0.6.11” or “latest”) |
Examples
Section titled “Examples”Basic usage (latest version)
Section titled “Basic usage (latest version)”Specific version
Section titled “Specific version”How git-absorb works
Section titled “How git-absorb works”git-absorb automatically identifies which commits your staged changes belong to and creates fixup commits for them.
Workflow example:
Section titled “Workflow example:”-
Make some commits:
-
Make changes to files (fix bugs, improve code, etc.)
-
Stage your changes:
-
Let git-absorb work its magic:
git-absorb will automatically create fixup commits that can be squashed into the appropriate original commits using git rebase --autosquash.
Preview changes first:
Section titled “Preview changes first:”This shows what git-absorb would do without actually creating commits.
Commands
Section titled “Commands”Once installed, you can use git-absorb in several ways:
As a Git subcommand:
Section titled “As a Git subcommand:”As a standalone command:
Section titled “As a standalone command:”Use cases
Section titled “Use cases”- Bug fixes: Fix a bug and let git-absorb put the fix in the right commit
- Code improvements: Refactor code and automatically organize changes
- Documentation: Add comments or docs and absorb them into relevant commits
- Style fixes: Fix formatting and absorb into the commits that introduced the code
- Use —dry-run first to see what git-absorb plans to do
- Stage only what you want to absorb - git-absorb only works with staged changes
- Works best with recent commits - git-absorb looks at recent history to find matching commits
- Combine with git rebase —autosquash to clean up your branch before merging
Requirements
Section titled “Requirements”- Git must be installed and configured
- Linux x86_64 or aarch64 architecture
- Recent commits in your repository (git-absorb needs context to work with)
Architecture support
Section titled “Architecture support”- ✅ Linux x86_64 (amd64)
- ✅ Linux aarch64 (ARM64)
- ❌ Other architectures (not supported by upstream git-absorb releases)
Troubleshooting
Section titled “Troubleshooting”- “No commits available to fix up”: You need existing commits for git-absorb to work with
- Changes not absorbed: Make sure your changes are staged (
git add) - Binary not found: Check that
/usr/local/binis in your PATH
About git-absorb
Section titled “About git-absorb”git-absorb is created by tummychow and is inspired by Facebook’s hg absorb command for Mercurial. It uses advanced heuristics to determine which commits your changes should be absorbed into.
For more information, visit the official git-absorb repository.
Contributing
Section titled “Contributing”This feature is part of the helpers4/devcontainer-features repository. Contributions and issues are welcome!