I would like to better understand something I am observing with Git, using git --version 2.39.2
.
In a repo, I have two long-lived branches, the default master
and a new
one, branched from master
several months ago. In the last months, there was some maintenance work done in master
, with occasional cherry-picking into new
. On the other hand, there was a lot of work on new
, with many PRs merged into it and more than 600 commits on top of the branching point.
I now want to rebase new
on top of master
, to then merge new
into master
. When rebasing, I had a few minor conflicts, which however risked to spoil the history, as for instance they would make it harder to track which dependency versions were used exactly back in time. I thus decided to do the following:
- I added (locally) a commit to
master
, bringing its state back to the common ancestor of the two branches. I used this: https://stackoverflow.com/a/51906191/6760680 - I then rebased
new
on top of this "edited"master
, which also implies that it's rebased on top of the remotemaster
, so I can use this rebased version to merge.
Now, the question is: why did I still get some (small) conflicts, when doing this procedure?
I was rebasing on top of a state that was identical to the common ancestor of the two branches, so I expected no conflict at all. I am slightly worried that the history might be messed up due to this (hard to check, as it's many commits, as I said), even if the final state of the branch is the expected one. Note that I rebased with the --rebase-merges
option, because I want to keep the merge commits, not sure if that can be related. Can somebody with deeper Git insights illuminate me?