git rebase: what can go wrong?

git rebase: what can go wrong?

Julia Evans
@b0rk thanks for this! Your solution for ‘undoing a rebase’ is going to save me a bunch of time (whenever I do a knarly rebase I’ve been creating a “backup” brach from my starting point and then using that as a “target” for git reset if something goes wrong 😅)
@petert ooh I think I'll mention the "backup branch" workaround too, that's really smart
@b0rk @petert What happens if the GC runs before you get a chance to undo the rebase? Will be old commit even be there? According to docs, many commands automatically trigger the GC depending upon the repo size. Backup branch may be a safer bet here. (I use the same concept to preserve development history).
@b0rk @petert I use backup branches all the time. After a rebase with merge conflicts, especially when rewriting history, I’ll typically git diff between the rebased branch and the backup just to check I didn’t do anything stupid like drop or duplicate a line.