r/git • u/TachikawaKan5241 • 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
View all comments
2
u/CarryTheBoat 1d ago
You can commit a shitload, I’d just do it on a branch so you can easily squash merge it to something clean once everything is sorted out.
But sometimes cheap tiny commits are faster when your debugging or prototyping an idea if you find yourself getting down a rabbit hole that isn’t going anywhere and just blow away the changes and start on a new angle.
Just make sure your first commit message is “initial commit” and then all the rest are “committing files before <insert some event>” or “made some changes”