Git – Refusing to merge unrelated histories

I ran into the following Git errors today when adding a new project to an existing Git repo.

$ git pull
fatal: refusing to merge unrelated histories

The initial steps I took to add my project the existing repo were the following.

  • git init
  • git add .
  • git commit – m “comment”
  • git remote add origin <repo url>
  • git remote -v
  • git push origin master

For what ever reason I was forced to do a reset –hard.  After this, I tried a pull and encountered the unrelated histories error. (ODD)

Solution: git pull –allow-unrelated-histories