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. :)