Probably because you did a `git init` on something like "the same" set of files locally, then tried to merge with the files on the repository. The better way is to clone from the repository, then work from that.
I had just created a README.md while initiating a new Repositoy. after adding remote origin the issue rised on git pull. but this is really helful to solve my problem.
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