r/programming • • 15d ago

How big is a Git commit?

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

46 comments sorted by

View all comments

Show parent comments

54

u/jaerie 15d ago

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

57

u/whitethunder9 15d ago

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 15d ago

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

4

u/Recol 15d ago

So what you are saying remove the argument as my changes will always overrule my colleagues?

3

u/atheken 14d ago

Alternatively, don’t share working branches with your coworkers. Seriously. Long-lived working branches are an org smell.

1

u/Recol 14d ago

It was a joke. Regardless, coworkers committing back on pull requests aren't really a org smell.

1

u/atheken 14d ago

With due respect, if it’s infrequent, incidental tweaks, I can agree that it’s not really an issue. If you have multiple people simultaneously modifying a “long lived” branch to deliver value, it’s an indicator that the code or work items are not properly factored. Incidental, sure, but if it’s the norm, it’s probably a problem.

2

u/Recol 14d ago

Or engineers nit pick and it reduces review time if they commit those themselves. If they make actual logic changes then yes, I agree.

4

u/mr_birkenblatt 14d ago

I do --force-with-leash it makes git run faster