gpt4 book ai didi

Git 拒绝在 rebase 上 merge 不相关的历史记录

转载 作者:IT王子 更新时间:2023-10-29 01:07:05 30 4
gpt4 key购买 nike

git rebase origin/development 期间,Git 显示以下错误消息:

fatal: refusing to merge unrelated histories
Error redoing merge 1234deadbeef1234deadbeef

我的 Git 版本是 2.9.0。它曾经在以前的版本中运行良好。

如何使用新版本中引入的强制标志继续此 rebase 以允许不相关的历史记录?

最佳答案

您可以使用 --allow-unrelated-histories 强制 merge 发生。

这背后的原因是自 Git 2.9 以来默认行为发生了变化:

"git merge" used to allow merging two branches that have no commonbase by default, which led to a brand new history of an existingproject created and then get pulled by an unsuspecting maintainer,which allowed an unnecessary parallel history merged into theexisting project. The command has been taught not to allow this bydefault, with an escape hatch --allow-unrelated-histories optionto be used in a rare event that merges histories of two projectsthat started their lives independently.

参见 Git release changelog获取更多信息。

More information可以在这个答案中找到。

关于Git 拒绝在 rebase 上 merge 不相关的历史记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37937984/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com