this post was submitted on 07 Feb 2025
741 points (99.2% liked)

Programmer Humor

33556 readers
136 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 88 points 2 weeks ago (2 children)

If you've ever royally fucked something up in git, that hotline is necessary

[–] [email protected] 23 points 2 weeks ago (1 children)
[–] [email protected] 9 points 2 weeks ago (1 children)

I have been that friend from the alt text at every place I have worked. I shudder to think how they're going about their projects without me, now.

[–] [email protected] 2 points 2 weeks ago* (last edited 2 weeks ago)

I'm kinda planning on teaching my team how to use interactive rebases to clean the history before a merge request.

The first thing they'll learn is to make a temporary second branch so they can just toss their borked one if they screw up. I'm not going to deal with their git issues for them.

[–] expr 20 points 2 weeks ago (1 children)

Never understood why this is such a trope. There's very little you can't recover in git (basically, only changes you never committed in the first place).

[–] [email protected] 3 points 2 weeks ago (1 children)

Have you ever tried a rebase?

[–] expr 29 points 2 weeks ago

Not sure if serious or not, but yeah I use interactive rebases every day, many times a day (it's nice for keeping a clean, logical history of atomic changes).

It's very simple to recover if you accidentally do something you don't intend (git rebase --abort if the rebase is still active, git reflog to find the commit before the rebase if it's finished).