+5 votes
1 view
in Devops and Agile by (29k 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

+6 votes
by (49.5k 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 (20k points)
As the release note suggests this command git rebase origin/development --allow-unrelated-histories will allow unrelated histories.
Welcome to Intellipaat Community. Get your technical queries answered by top developers !