r/programming • • Oct 08 '26

How big is a Git commit?

https://ratfactor.com/cards/git-commit-size
159 Upvotes

46 comments sorted by

View all comments

185

u/nmopqrs_io Oct 08 '26

This is why I always just amend my first commit and re-push it with force, saves on disk space.
If you’re not using force, are you really using git?

54

u/jaerie Oct 09 '26

I use --force-with-lease. No idea what it does but it feels safer

57

u/whitethunder9 Oct 09 '26

If there are changes that didn’t come from you on remote then force with lease won’t force push over them

9

u/OMG_A_CUPCAKE Oct 09 '26

Add --force-if-includes here. If you (or your IDE) already fetched, --force-with-lease alone won't protect you.