this work for me...
git clone <Repo>
git pull --allow-unrelated-histories origin master
git push -u origin master
and it works
if you already did a pull and you came up with master and origin/master but can't merge them, the following command can help you:
git merge origin/master --allow-unrelated-histories
Its not working when I run the command on git bash.
$ git pull --allow-unrelated-histories
Result: fatal: not a git repository (or any of the parent directories): .git
Someone please make this answer show up at the top of the thread lol! It fixed the problem for me and the current top positioned comment is completely the incorrect practice for solving the issue. Thanks again for correct pull to stop the unrelated histories error.