- cross-posted to:
- programming@programming.dev
- cross-posted to:
- programming@programming.dev
To me, where
git rebase
really shines is ingit rebate --interactive
. It’s a shame that command is not a first class citizen.The mental model for rebasing commits is to move branches around in the git tree, but
git rebase --interactive
does something extremely useful that’s only incidentally related to rebasing, which is changing the order of commits. This usecase happens all the time when working in feature branches, particularly if you decide to push a subset of the work you’re doing as a separate pull request.I think the main reason
rebase --interactive
is not well known is the people shouting “don’t userebase
ever” without bothering to provide a nuanced explanation of their warning. Many newcomers will avoidrebase
altogether without trying to understand what it does.Git developers created
switch
andrestore
commands to clarify the user facing functionality ofcheckout
. Not sure if they would do the same forrebase --interactive
(something likegit rearrange
, terrible name, I know). That would bring it to people’s attention bypassing the witch-hunt aroundrebase
. But I wouldn’t hold my breath.