This command is a dangerous one. "git pull --allow-unrelated-histories" it has messed up my whole codebase i dont know what happened and am not in a position to recover from it
Thanks, Woked superbly for me as well.
but little more specific:
git pull <remote> <branch> --allow-unrelated-histories
I got this error, but found another cause:
somehow, the ssh url of another project got into this one's .git/config file.
So before running this to accept 'unrelated histories', you may want to confirm you have the right repo's url.
I fixed mine and it started working again. :)
I was also facing the same problem. But I realised I was trying to push my one git project material on other remote git project. Solution:
Clone the fresh project again and this time make sure cloning link is starting from ssh if you have added the SSH key and https:// if you have added the puttyKey.