[Solved] Git pull error: “fatal: refusing to merge unrelated histories”

When you have two unrelated projects (two different repositories), and you try to pull and merge files, The “fatal: refusing to merge unrelated histories” Git error occurs.

Solution: use –allow-unrelated-histories

git pull origin branchName --allow-unrelated-histories

Sources:

https://www.educative.io/edpresso/the-fatal-refusing-to-merge-unrelated-histories-git-error

https://stackoverflow.com/questions/37937984/git-refusing-to-merge-unrelated-histories-on-rebase

Don’t miss these tips!

We don’t spam! Read our privacy policy for more info.

Open chat
Powered by