r/ExperiencedDevs • • Aug 19 '25

Never commit until it is finished?

How often do you commit your code? How often do you push to GitHub/Bitbucket?

Let’s say you are working on a ticket where you are swapping an outdated component for a newer replacement one. The outdated component is used in 10 different files in your codebase. So your process is to go through each of the 10 files one-by-one, replacing the outdated component with the new one, refactoring as necessary, updating the tests, etc.

How frequently would you make commits? How frequently would you push stuff up to a bitbucket PR?

I have talked to folks who make lots of tiny commits along the way and other folks who don’t commit anything at all until everything is fully done. I realize that in a lot of ways this is personal preference. Curious to hear other opinions!

76 Upvotes

315 comments sorted by

View all comments

1

u/CompassionateSkeptic Aug 23 '25

I will add a described commit if I can put words to a change at it functions before and after and I will amend into a wip (work in progress) commit until that’s true. These are usually extremely granular changes and often don’t need wips.

I will also often do interactive rebase on my feature branch and consolidate or reorganized the “atoms” such that more related ones will be chunked together.

On teams that see this level of granularity as less than ideal, I’ll either squash and merge or squash the chunks.

1

u/CompassionateSkeptic Aug 23 '25

If a partial completion of a ticket offers a unit of change for main that I like and has test coverage, I’ll consider making a PR for that. Multiple PRs for ticket.

Even more liberal if I have good feature flag coverage.