Hacker News new | ask | show | jobs
by DamagedProperty 5402 days ago
I like to think about my commits as units of work that I can pull back or cherry pick if I want to. It doesn't always work out that way.

Make sure your commits are cohesive to the change you are making. I think that is a good rule of thumb.

1 comments

Yes, definitely nice if you can make your commits atomic changes. The more easily able to right a nice summary line (50 chars please!) the better.

On the other hand, some changes are big and messy. In this case I sometimes do intermediate commits, especially if it's at the end of a day just so I can keep yesterdays changes conceptually separate from todays. In the end I may rebase -i the whole thing and clean things up before pushing, but only if there are some obvious and quick ways to split it up.