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
5
u/Comprehensive_Mud803 1d ago
How often do you feel that you need to make backup or safeguard?
From experience, there’s no “too often”.
The perfect answer is “often enough to be safe from data loss”.
You can always squash commits together during an interactive rebase, or squash the whole PR branch on merge.