Loading...
Loading...
fatal: refusing to merge unrelated historiesThis error happens when you try to pull or merge two branches that have no shared commit history. Git sees them as two completely different projects and refuses to merge them by default to prevent accidental data loss.
Use the --allow-unrelated-histories flag to tell Git it's okay to merge them.
git pull origin main --allow-unrelated-histories
# Resolve any merge conflicts that appear
# Then commit the resultIf you just want your local code to overwrite the empty remote repo, force push.
git push --force origin main