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

84 comments sorted by

View all comments

Show parent comment

3

u/boomkablamo 2d ago

You should pretty much never be committing, or more importantly pushing, directly on main...

1

u/dmazzoni 2d ago

You can if it’s your own repo and you’re the only developer.

Even at work I keep lots of repos for my own tools and scripts. I push changes directly to main.

1

u/boomkablamo 2d ago

You can do whatever you want in your own repo. But seems like OP wants to know best practices.