Here's a small thing that has made my git workflow less tedious.
When you're working on a feature branch and get review feedback, you usually end up doing this:
- Make your fixes
- Find the commit SHA that needs the fix
git commit --fixup <sha>git rebase -i --autosquash
Step 2 is the annoying part. You're scanning git log, copying the SHA, maybe getting it wrong.
git-absorb automates the bookkeeping. You stage your files, run git absorb, and it figures out which commits your changes belong to and creates the fixup commits for you.
git add $FILES_YOU_FIXED
git absorb
If you trust it, --and-rebase squishes everything in one go:
git add $FILES_YOU_FIXED
git absorb --and-rebase
If you want to check first, just run git absorb without the flag, look at what it generated with git log, then run git rebase -i --autosquash yourself.
It's a Rust port of hg absorb, built by Facebook. Install it from the releases page or via cargo.
The workflow it enables is clean: make your changes, stage the files, let the tool sort out which commit gets what. No SHA hunting.
If you're still doing fixups manually, give it a try.
Top comments (0)