Explore Courses Blog Tutorials Interview Questions
+4 votes
in DevOps and Agile by (29.3k points)
edited by


git rebase origin/development

the following error message is shown from Git:

fatal: refusing to merge unrelated histories

Error redoing merge 1234deadbeef1234deadbeef

My Git version is 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?

1 Answer

+5 votes
by (50.2k points)
edited by

* "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.  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.

Please refer the release note of version 2.9 release note you will find above information

And now to allow unrelated histories use the command 

git rebase origin/development --allow-unrelated-histories

For better understanding about these commands go through the following crash course on git that will help you to understand git well

by (19.4k points)
As the release note suggests this command git rebase origin/development --allow-unrelated-histories will allow unrelated histories.

Browse Categories