Rain Lag

The Commit Triage Habit: A Simple Way to Rescue Half-Finished Ideas Hiding in Your Git History

Learn how to turn your messy Git history into a steady stream of reusable ideas by making commit triage a recurring habit, from listing stale branches to extracting patterns and cleaning up experiments.

The Commit Triage Habit: A Simple Way to Rescue Half-Finished Ideas Hiding in Your Git History

Your Git history is probably full of ghosts.

Half-finished features. Experimental refactors. Spikes you swore you’d “come back to later.” All of them are sitting quietly in branches you haven’t touched in months.

Most teams treat these branches as clutter. But hidden inside them are reusable patterns, smarter ideas than your current implementation, and shortcuts your future self would love to have.

This is where commit triage comes in.

Commit triage is a simple, recurring habit: regularly review your branches, decide what to do with each one, extract anything valuable, and clean up the rest. Done right, it turns your Git history into a mine of reusable ideas instead of an unmanageable graveyard.

In this post, you’ll learn:

  • How to quickly surface your most promising half-finished work
  • A practical process for triaging each branch
  • How to clean up noisy history so only useful experiments remain
  • Ways to mine old branches for reusable patterns and utilities
  • How to document triage results so your roadmap and technical debt stay visible

Why Your Git History Is More Valuable Than You Think

Developers often underestimate the value of their abandoned branches. “Old,” “stale,” or “experimental” does not mean useless. It usually means:

  • The idea was ahead of its time or blocked by a dependency
  • You learned something but never formalized it into reusable code
  • You abandoned it under deadline pressure, not because it was bad

Those branches are basically R&D storage:

  • Alternative designs
  • Partial refactors
  • Performance experiments
  • Quick prototypes of features that didn’t make the cut (yet)

Treating your Git history as an archive of reusable ideas shifts the goal. You’re not just cleaning up old branches. You’re mining them for patterns you can reuse across projects.


Step 1: Surface the Freshest Work with One Command

You don’t need to scroll through dozens of branches manually. Start triage where value is most likely to be found: the most recently touched branches.

Use:

git branch --sort=-committerdate

This sorts branches by the date of their last commit, with the freshest work at the top.

Why this matters:

  • Recent branches are more likely to be relevant to your current architecture
  • You’ll remember context more easily
  • The probability is higher that you left something useful unfinished

From this list, choose a manageable number of branches to triage in a single session—say, 3–5 branches. The key to making this a habit is to keep it small and repeatable.


Step 2: The Commit Triage Decision Tree

For each branch you review, make one explicit decision:

Finish it, refactor it, merge it, or close it.

Here’s a simple workflow you can follow.

1. Check What’s There

For each branch:

git checkout your-branch-name git log --oneline --graph --decorate | head

Skim the changes:

  • What problem was this solving?
  • Is that problem still relevant?
  • How far along is the solution?

2. Choose Its Fate

Option A: Finish It

Use this when:

  • The feature or refactor is still valuable
  • The work is 60–90% done
  • You can realistically complete it soon

Action steps:

  • Create or update a ticket/issue describing the remaining work
  • Rebase against main (or your trunk branch) if needed
  • Schedule this into your upcoming sprint or personal plan

Option B: Refactor It

Use this when:

  • The idea is good, but the implementation no longer fits your codebase
  • The branch is tangled, noisy, or mixed with unrelated changes

Action steps:

  • Cherry-pick the important commits into a fresh branch
  • Rewrite them in terms of your current architecture
  • Close the original branch once the new one replaces it

Option C: Merge It

Use this when:

  • The work is effectively done but never merged
  • Only small fixes or conflict resolutions are needed

Action steps:

  • Run tests, resolve conflicts, and merge
  • Add a short summary in the merge commit or pull request description:
    • What the branch attempted
    • Any trade-offs or follow-up work

Option D: Explicitly Close It

Use this when:

  • The feature is no longer needed
  • The approach is obsolete
  • The cost to revive it outweighs the benefit

Action steps:

  • If using a remote like GitHub/GitLab:

    git branch -d your-branch-name # local git push origin --delete your-branch-name # remote
  • Add a note in your tracker: “Closed branch X: approach obsolete; replaced by Y.”

The clarity here is the point. You’re not just letting branches rot—you’re deciding their fate.


Step 3: Clean Up the Truly Unwanted Stuff

Some branches don’t just represent ideas; they contain noise:

  • Huge binary files accidentally committed
  • Large data dumps used for local testing
  • Generated files that never should have been in version control

If these are limited to a disposable branch, you can often just delete the branch and move on.

But if unwanted files have polluted your core history, use tools like git-filter-repo to remove them and rewrite history cleanly.

Examples of when git-filter-repo helps:

  • Removing accidentally committed secrets
  • Deleting large media or build artifacts from all history
  • Renaming or moving top-level directories in a clean way

By cleaning up the truly unwanted artifacts, you ensure that what remains in your Git history is:

  • Small enough to clone quickly
  • Free of sensitive or irrelevant junk
  • Focused on valuable experiments and real work

Step 4: Mine Branches for Reusable Patterns

Even when a branch isn’t worth finishing or merging, parts of it often are.

Get into the habit of asking:

“Is there a pattern here I’d want to reuse?”

Look for:

  • Utility functions you keep rewriting
  • Common setup or boilerplate code
  • Helpful logging, tracing, or debugging snippets
  • Reusable UI components or layout patterns

Turn Fragments into Shared Utilities

When you spot something reusable, extract it:

  • Move utilities into a shared module or library in your repo
  • Turn repeated code into templates or project generators
  • Create snippets for your editor from commonly reused patterns

Think of this like working with a game engine such as Godot:

  • Game developers build reusable scenes, scripts, and patterns
  • Over time, they form a toolbox of reliable, drop-in components

Your Git history can play the same role. Those old branches are prototypes for patterns you can standardize and reuse across projects.


Step 5: Document Each Triage Session

The final (and often skipped) step is to write down what happened.

After each triage session, capture:

  • Which branches you touched
  • What decision you made for each (finish, refactor, merge, close)
  • What you extracted (new utilities, patterns, templates)
  • Any follow-up work you created

You can log this:

  • In your project tracker (Jira, Linear, GitHub Projects, etc.)
  • In a simple docs/triage-log.md file
  • In a team wiki page like “Branch Triage – YYYY-MM”

Why document it?

  • Your roadmap gains clarity: you can see pending work vs. abandoned paths
  • Technical debt becomes visible and trackable, not just “felt”
  • Future team members can see why branches disappeared or ideas changed

Example of a simple log entry:

### Triage session – 2025-01-12 - `feature/async-refactor`**Finish** - Still relevant, ~70% done - Created ticket #482 for remaining tasks - `spike/new-cache-strategy`**Extract + Close** - Extracted `cache_utils.py` into `shared/cache/` - Closed branch; approach replaced by #451 - `experiment/ui-theme-v2`**Close** - Design direction obsolete after new branding

This record keeps your future self from repeating the same evaluation—and helps others understand past decisions.


Making Commit Triage a Habit

Commit triage delivers value only if you repeat it.

Some lightweight ways to build the habit:

  • Schedule a 15–30 minute triage session once per week
  • Add “run git branch --sort=-committerdate” to your weekly checklist
  • Pair on triage with another teammate to share context
  • Tie triage to a natural milestone (end of a sprint, release, or month)

You don’t need to clear all branches at once. The goal is gradual, steady improvement:

  • More ideas rescued or reused
  • Less clutter and confusion
  • A healthier, more understandable repository

Conclusion: Your Git History Is a Design Asset, Not a Dump

Your Git repo is more than a code archive. It’s a history of your thinking: experiments, abandoned directions, and almost-finished ideas.

By adopting a simple commit triage habit—

  • Listing branches by recency with git branch --sort=-committerdate
  • Deciding to finish, refactor, merge, or close each branch
  • Cleaning up truly unwanted files with tools like git-filter-repo
  • Mining branches for reusable patterns and utilities
  • Documenting the outcome of each triage session

—you turn that history into an asset instead of a liability.

Treat triage less like housekeeping and more like mining: you’re looking for patterns, shortcuts, and insights that will make your future work faster and better.

There are probably valuable ideas hiding in your Git history right now. All you need is a small, repeatable habit to bring them back to life.

The Commit Triage Habit: A Simple Way to Rescue Half-Finished Ideas Hiding in Your Git History | Rain Lag