You should be able to use the "ours" merge strategy to overwrite master with seotweaks like this:
(您应该能够使用“我们的”合并策略,用seotweaks覆盖master,如下所示:)
git checkout seotweaks
git merge -s ours master
git checkout master
git merge seotweaks
The result should be your master is now essentially seotweaks.
(结果应该是您的主人现在基本上是seotweaks。)
( -s ours
is short for --strategy=ours
)
(( -s ours
是--strategy=ours
))
From the docs about the 'ours' strategy:
(从有关“我们的”策略的文档中 :)
This resolves any number of heads, but the resulting tree of the merge is always that of the current branch head, effectively ignoring all changes from all other branches.
(这样可以解析任意数量的head,但是合并的结果树始终是当前分支head的树,有效地忽略了所有其他分支的所有更改。)
It is meant to be used to supersede old development history of side branches. (它旨在取代侧支的旧开发历史。)
Note that this is different from the -Xours option to the recursive merge strategy. (请注意,这与递归合并策略的-Xours选项不同。)
Update from comments: If you get fatal: refusing to merge unrelated histories
, then change the second line to this: git merge --allow-unrelated-histories -s ours master
(注释更新:如果您致命: refusing to merge unrelated histories
,然后将第二行更改为:git merge --allow-unrelated-histories -s ours master
)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…