News for hackers. Stuff that matters.
Re:Beej's Guide to Git by maccard on Wednesday February 05, 2025 @03:53AM (#42945832)
> Find your last entry before the rebase using the reflog and reset your local branch to that entry.

You shouldn’t ever need to go to the reflog unless you’re in an exceptional case, and fit makes it very very easy to get into that exceptional case.

Re:Beej's Guide to Git by diggan on Wednesday February 05, 2025 @09:10AM (#42948685)
> You shouldn’t ever need to go to the reflog unless you’re in an exceptional case

If "loosing your work and it's not in the git log" isn't an exceptional case, what exactly is a "exceptional case"?

Re:Beej's Guide to Git by maccard on Wednesday February 05, 2025 @11:15AM (#42950649)
> If "loosing your work and it's not in the git log" isn't an exceptional case, what exactly is a "exceptional case"?

Losing your work should be exceptional. It's very, very easy to fuck a rebase up, and rebasing is (like it or lump it) a common operation. You shouldn't one step away from an exceptional case from a daily operation.

Re:Beej's Guide to Git by diggan on Wednesday February 05, 2025 @11:30AM (#42950908)
Powerful tools have powerful consequences, case in point: with `rm` you're always one mistake away from blowing away large parts of your work.
Re:Beej's Guide to Git by _proofs on Friday February 07, 2025 @01:28PM (#42975853)
this is solved by branching your feature again and rebasing from that or the feature original in case the rebase gets fucked.

you don't have to treat rebases or merges as this black hole of "i have no recourse for not getting it perfect the first time".