• rmam@programming.dev
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    1 year ago

    To me, where git rebase really shines is in git 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.

    • canpolat@programming.devOPM
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      I think the main reason rebase --interactive is not well known is the people shouting “don’t use rebase ever” without bothering to provide a nuanced explanation of their warning. Many newcomers will avoid rebase altogether without trying to understand what it does.

      Git developers created switch and restore commands to clarify the user facing functionality of checkout. Not sure if they would do the same for rebase --interactive (something like git rearrange, terrible name, I know). That would bring it to people’s attention bypassing the witch-hunt around rebase. But I wouldn’t hold my breath.