this post was submitted on 07 Feb 2025
742 points (98.9% liked)

Programmer Humor

33546 readers
325 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] 24 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) (1 children)

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.

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

I'm kinda planning on teaching my team

I'm not going to deal with their git issues for them.

These two statements contradict each other.

[–] [email protected] 2 points 1 week ago

I disagree. I don't wanna deal with my coworkers work, so I'm teaching them to deal with it themselves. Not necessarily in the best way for them to do it, but in an easy way to teach and an easy way to get right

[–] [email protected] 2 points 2 weeks ago

That's why I'll make damn sure they'll make that second branch first.

Mind you, the most likely result is that I'll still see branches with 50+ commits with meaningless names because nobody ever rebases anything.

[–] [email protected] 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?

[–] [email protected] 28 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).