For example, I have the following:
A--B (master)
\
C--D (feature)
If I do git rebase master feature git takes diff between commits A and C and applies it on top of the commit B, then it takes diff between commits C and D and applies it on top of new commit C'. Git calls it replaying changes. Now if I merge feature into master what process does actually happen?
My assumption based on what I've read is that git finds common ancestor, A in this case`, then:
- takes
diffbetween last commit on branchfeature, here betweenAandD - takes
diffbetween last commit on branchmaster, here betweenAandB - applies
difffrom step 1 and step 2 to common ancestor
Is this correct? I've decided to confirm that because in git documentation replaying changes also is mention when referring to merge operation.