WIP commits, clean history: My short-lived Git branch workflow
- Dec 1, 2026
I create lots of WIP commits while I work. The code ends up in master, but the WIP commits don’t.
Before a branch is merged, I rewrite its history into a handful of small, deliberate commits that each tell part of the story: “INV-482 Extract due date calculation into PaymentTerms”, then “INV-482 Fix due date calculation for invoices issued in December”.
My branches are short-lived: most live for a few hours or a couple of days, and almost none last longer than a week before they’re merged into master and released. It’s effectively scaled trunk-based development, where I use my working branch as a private scratchpad and tidy it before creating the pull request.
In this article I’ll walk through my workflow, the git commands involved, and why tidying up commits before review has been worth it over the last 15+ years of doing so.
