I created a local repo with git remote origin https:////...
.
Then, in that local repo, I made a new text file → git add newfile.txt
→ git commit -m "..."
→ git pull origin main
→ ERROR!
"refusing to merge unrelated histories".
What are unrelated histories?
What are related histories?
I think you have committed in the remote repository, and when you pull, this error happens.
Use this command:
git pull origin main --allow-unrelated-histories
git merge origin origin/main