Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
557 views
in Technique[技术] by (71.8m points)

git - Git拒绝合并基础上无关的历史记录(Git refusing to merge unrelated histories on rebase)

During git rebase origin/development the following error message is shown from Git:

(在git rebase origin/development过程中,Git显示以下错误消息:)

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

My Git version is 2.9.0.

(我的Git版本是2.9.0。)

It used to work fine in the previous version.

(以前在以前的版本中可以正常工作。)

How can I continue this rebase allowing unrelated histories with the forced flag introduced in the new release?

(如何在新版本中引入强制标记的情况下继续进行此基础更改,以允许不相关的历史记录?)

  ask by Shubham Chaudhary translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The default behavior has changed since Git 2.9:

(自Git 2.9起,默认行为已更改:)

"git merge" used to allow merging two branches that have no common base by default, which led to a brand new history of an existing project created and then get pulled by an unsuspecting maintainer, which allowed an unnecessary parallel history merged into the existing project.

(默认情况下,“ git merge”用于允许合并没有共同基础的两个分支,从而导致创建现有项目的全新历史记录,然后由毫无戒心的维护者提取,从而允许将不必要的并行历史记录合并到现有项目中。)

The command has been taught not to allow this by default , with an escape hatch --allow-unrelated-histories option to be used in a rare event that merges histories of two projects that started their lives independently.

(该命令已被--allow-unrelated-histories 默认情况下不允许这样做,在一个罕见的事件中使用了逃生阴影--allow-unrelated-histories选项,该事件合并了两个独立启动项目的历史。)

See the Git release changelog for more information.

(有关更多信息,请参见Git发行变更日志 。)

You can use --allow-unrelated-histories to force the merge to happen.

(您可以使用--allow-unrelated-histories强制进行合并。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...