r/git • • 2d ago

How often should I commit my changes?

I am fairly new to programming and git and I was just wondering how often I should commit my changes both locally and to Github? I feel like I'm doing it to often

9 Upvotes

83 comments sorted by

View all comments

2

u/Janky-Code 1d ago

If by yourself or with partners on a project you are enthusiatic about, commit frequently, push regularly, and keep pull requests small for easy review.

If with people you don't like on work you couldn't care any less about, once a week at most. Add commit messages like "fix: fix minor changes." Squash all commits into "fix fix." Save up pull requests so they are so large that whoever has to review and test them hates you. If they reject your pr, close it and open a new one. Add terse comments or better yet incorrect comments.

1

u/AlleyOcelot 1d ago

they're being sarcastic if thats not obvs ha. but this is a perfect negative example that does actually take place in the real world. ymmv