Alberto A. Flores

Alberto A. Flores

Sr. Software Engineer

© 2022

Dark Mode

Git: refusing to merge unrelated histories

Most recently, I found the following error during a git operation:

  $ git pull
  fatal: refusing to merge unrelated histories

which led me to a hunt. I found out that since version 2.9.0, git has removed the ability to merge branches with unrelated histories (kudos to the git developers for the obvious message!). This change (and many others) can be found here.

The fix (for me) was found in doing the following:

  $ git pull --allow-unrelated-histories

I suppose that this is relevant if you are concerned about “related” history.