• expr@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    9 months ago

    No, there are no fast-forwards with rebasing. A rebase will take take the diff of each commit on your feature branch that has diverged from master and apply those each in turn, creating new commits for each one. The end result is that you have a linear history as though you had branched from master and made your commits just now.

    If you had branched like this:

    A -> B -> C (master)
       \
         \ -> D (feature)
    

    It would like this after merging master into your feature branch:

    A -> B -> C (master) ->   E (feature)
      \                                    /
        \ -> D -------------------> /
    

    And it would like this if you instead rebased your feature branch onto master:

    A -> B -> C (master) -> D' (feature)
    

    This is why it’s called a “rebase”: the current state of master becomes the starting point or “base” for all of your subsequent commits. Assuming no conflicts, the diff between A and D is the same as the diff between A and D'.