Migrating a merge based project to new tree
Renato Botelho
garga at FreeBSD.org
Wed Dec 23 14:29:17 UTC 2020
On 23/12/20 11:15, Shawn Webb wrote:
> On Wed, Dec 23, 2020 at 09:35:11AM -0300, Renato Botelho wrote:
>> I'm working to migrate a downstream stable/12 based tree to the new git
>> repository following instructions from [1].
>>
>> I did a final merge from legacy repository and made sure top commits on both
>> branches point to the same tree:
>>
>> # git show -s --format=%T f4d0bc6aa6b9
>> 98db7229803a5c93e3132bc661201f204487eee9
>> # git show -s --format=%T f262e04c92d7
>> 98db7229803a5c93e3132bc661201f204487eee9
>>
>> When I try to merge new one git refuses to merge due to unrelated histories.
>> Should I use --allow-unrelated-histories parameter?
>>
>> [1] https://github.com/freebsd/git_conv/wiki/Migrating-merge-based-project-from-legacy-git-tree
>
> HardenedBSD's in the same boat. We're toying around with different
> methods of fixing our repo right now. When I used
> --allow-unrelated-histories, git noted merge conflicts on every single
> file HardenedBSD has touched over the last 7.5 years. I tacked on "-X
> ours" and that made git happy. However, I'm unsure git always did the
> right thing. I'm working to verify that this week along with trying
> the other documented methods.
I've managed to do it adding `-s ours` to change merge strategy and
preserve our changes.
git merge legacy/stable/12
git push origin devel-12
git merge --allow-unrelated-histories -s ours freebsd/stable/12
After that I can confirm there are no differences:
# git status
On branch devel-12
Your branch is ahead of 'origin/devel-12' by 243035 commits.
(use "git push" to publish your local commits)
# git diff origin/devel-12
#
--
Renato Botelho
More information about the freebsd-git
mailing list