The “fatal: refusing to merge unrelated histories” Git error (original) (raw)

Consider the following two cases that throw this error:

Solution

The error is resolved by toggling the allow-unrelated-histories switch. After a git pull or git merge command, add the following tag:

git pull origin master --allow-unrelated-histories

More information can be found here, ​ on Git’s official documentation.