From 9af118a39623648a83327371391f4aa2b746734e Mon Sep 17 00:00:00 2001 From: syrell Date: Sun, 1 Dec 2024 21:26:38 +0100 Subject: [PATCH] feat: Added exercise 4 --- ex4/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ex4/README.md diff --git a/ex4/README.md b/ex4/README.md new file mode 100644 index 0000000..0f3e02e --- /dev/null +++ b/ex4/README.md @@ -0,0 +1,3 @@ +# Check diff + +We have a diff between merged and rebased branches because merge and rebase are two different process that will not necessarily end in the same result. With merge we retrieve the remote branch at current stage (HEAD points to latest commit from the remote branch) so we will end up with exactly the same code than on the remote branch. With checkout we retrieve all commits we don't have from remote branch onto the common ancestor and other commits from our local branch are put after. In our case, our local branch was A => B => F so afer the merge we end up with A => B => F => merge commit wheareas after the rebase we end up with A => B => C => D => E => F => G => B" => F" since the common ancestor is A. Although B and F from our local branch were cherry-picked from stein branch applying them on top of stein commits (A => B => C => D => E => F => G) made new changes. More precisely, some hunks modified by B are overriden by new commits from stein branch (C, D, E or G) therefore since the rebase process reapplied the B commit these hunks have been modified once more hence the diff we have between merged and rebased branches. Finally, hunks modified by F were not overriden by G thus reapplying F didn't make any new change that's why rebased branch git tree is A => B => C => D => E => F => G => B". \ No newline at end of file