Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why is rebase such a reviled git command? It's so useful. Interactive rebase is essentially a centralized place for editing history: reordering, squashing, amending, rewording, dropping, merging, splitting. Pretty much anything anyone could ever want to do can be done with interactive rebase. Enable autostashing and explicit dropping of commits and there's basically no way to screw things up. In the event that does happen somehow, reflog shows previous heads and even notes the point where the rebase began, making it easy to hard reset.

It's just so good. I don't know what I'd do without it.



Rebase (with or without -i) is one of my most used git commands. The one thing I still get confused with is whether I have to commit to continue or not.


It's so easy to end up in rebase hell where you're constantly fixing the same diffs. If you know what you're doing and can get the rebased commits to be pretty small it's okay. Although I've recently started using merge commits again and just squashing my branch when I merge into main.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: