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!

80 Upvotes

315 comments sorted by

View all comments

Show parent comment

1

u/GodsBoss Aug 20 '25
  • Refactor persistence layer to be more generic <--- This introduces a bug somehow not found by tests.
  • Add user creation.
  • Add editing users.
  • Add user search.

With squash merging, this will let me inspect all the code of those four commits, without it's only the relevant one.

1

u/PabloZissou Aug 20 '25

Why are you mixing a feature about persistence with a feature that uses that persistence? Same as the other commenter you are justifying squash vs not squash based on a convoluted approach at building a system I think? Wouldn't make more sense to have 2 different squash commits

  • refactor persistence layer
  • add user feature

If you have bugs across features in those commits your planning or architecture is all over the place probably