this post was submitted on 01 Jan 2026
232 points (99.6% liked)

Programmer Humor

28609 readers
1609 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] pivot_root@lemmy.world 32 points 2 weeks ago (1 children)

Solution:

git commit --amend
git push --force

Problem:

The process of discovering best practices on how to keep a clean git history is a goddamned challenge.

[โ€“] Ephera@lemmy.ml 18 points 2 weeks ago (1 children)

--force-with-lease* ๐Ÿ™ƒ

[โ€“] pivot_root@lemmy.world 7 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

I didn't want to make it sound too scary ๐Ÿ˜‰

Seriously, though, git really needs an option to treat --force as --force-with-lease. In the exceedingly rare occasion where I might want to completely overwrite a branch, it should be extra explicit by having to type something like --force-and-overwrite.

[โ€“] somerandomperson@lemmy.dbzer0.com 4 points 2 weeks ago (1 children)

--force-overwrite-everything-i-know-what-the-heck-i-am-doing
just to be sure... (/j)

[โ€“] technom@programming.dev 3 points 2 weeks ago

At this point, it may be a good idea to throw the entire git porcelain (frontend) away and redesign it from scratch!

[โ€“] Ephera@lemmy.ml 3 points 2 weeks ago

Yeah, I virtually only use --force for moving tags around (which one could definitely argue isn't really a thing you should be doing regularly either)...