r/git • u/TachikawaKan5241 • 1d 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
Show parent comment
1
u/symbiatch 18h ago
You literally answered your own question.
“A commit is a save point.”
That doesn’t mean it’s working correctly. It’s a point. “Here I made part 1 work, everything else isn’t working” is a save point. It’s broken since it doesn’t work fully, but it’s reasonable to save it.
Why would I want to revert to that? Because part 1 works. I broke rest more. Not working, let’s go back and do differently.
And then you even list how you commit “broken code.”
You also seem to confuse this with pushes and merges which are entirely different thing.