一、问题
在GitHub pull requests时出现There isn’t anything to compare. main and master are entirely different commit histories.
二、分析及解决
这是由于提交的分支与原有main完全不同导致系统不允许合并。
可能非最优但有用
# 切换分支至master
git checkout master
# 强制重命名master分支为main分支
git branch main master -f
# 切换分支至main
git checkout main
# 强制推送本地main分支至远程库,并覆盖远程main分支内容
git push origin main -f