this post was submitted on 07 Feb 2025
733 points (99.1% liked)

Programmer Humor

33315 readers
874 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
[–] NegativeLookBehind@lemmy.world 83 points 5 days ago (2 children)

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

[–] synae@lemmy.sdf.org 24 points 4 days ago (1 children)
[–] lord_ryvan@ttrpg.network 9 points 4 days 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.

[–] Jesus_666@lemmy.world 2 points 4 days ago* (last edited 4 days 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.

[–] corsicanguppy@lemmy.ca 3 points 4 days 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.

[–] JustAnotherKay@lemmy.world 2 points 3 days 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

[–] Jesus_666@lemmy.world 2 points 4 days 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.

[–] expr@programming.dev 20 points 5 days 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).

[–] AdamEatsAss@lemmy.world 3 points 5 days ago (1 children)

Have you ever tried a rebase?

[–] expr@programming.dev 28 points 5 days 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).