Japp
The branching flow I use when working solo

The branching flow I use when working solo

When you work alone you don't need full Gitflow. Here's how I organize branches in my personal projects.

For years I tried to apply Gitflow to the letter on all my projects, even the ones I was the only one working on. develop, release/*, hotfix/*, feature/*… all very tidy on paper, and also fairly ridiculous when the only person ever merging is you, at eleven at night.

Over the years I’ve settled on a much simpler version, and not because I read that “this is how it’s done at big companies” — it’s because one weekend I lost half an afternoon resolving conflicts between develop and release/1.4 that I’d created myself for no reason.

What I do now

main always has to be deployable. That doesn’t change. But instead of an intermediate develop branch, I work directly with short-lived branches: feature/favorites-cart, fix/badly-formatted-date, that kind of thing. They branch off main, live for a couple of days at most, and merge back into main with a normal merge. No forced --no-ff, no ceremony.

What about releases? If it’s a versioned project (a library, a WordPress theme like Lienzo), I tag the commit with git tag at deploy time. I don’t need a separate branch for that — the tag already tells me exactly what was in production at any given point, which is the only thing I really need to check later.

Why this and not less

I could just commit straight to main with no branches at all, which is tempting when you’re the only developer. I don’t, for a very specific reason: short branches force me to write a PR description, even if it’s for nobody but myself, and that summary of “what I’m changing and why” has saved me more than once when I’ve come back to a project six months later with no memory of what I was thinking.

I also still use GitHub even when working alone, for the same reason: a PR’s visual diff is better than the terminal’s, and leaving myself a comment on a specific line of code is more useful than it sounds.

None of this is dogma. If I work with someone else tomorrow, I go back to proper feature branches with real review and probably a bit more discipline. But for solo projects, the less process I invent, the less process I have to remember to follow.

Leave without saving?

You have unsaved changes in this form. If you leave now, they'll be lost.

esen