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

github-octocat

Hello, Welcome to DevOpsUnleashed!

A blog dedicated to sharing information about DevOps. Here, you’ll find examples, tips, and tutorials on DevOps.

Feel free to share your experiences in the comments!

Blog Categories