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!

82 Upvotes

315 comments sorted by

View all comments

1

u/mr_brobot__ Software Engineer Aug 20 '25

I try to make my commits easy to read through and understand. This doesn’t necessarily mean I wait until it’s fully done, but I do tend to commit less often, until I can cleanly organize my commits.

I might also wait until I have a bunch of work finished, and then I will create different commits, to help improve readability if someone was to read through the commit log.

I also squash merge my PRs and try to keep PRs as small as possible, so I’m being rather redundant…but once you feel the pain of having to go through the commit log to understand how your codebase has changed, you will have an appreciation for neatly organized commits.

Tbh I don’t expect team members to adhere to such a level of OCD when we’re squash merging anyways, but it’s how I personally like to operate.