刚刚在 Github 新建仓库然后上传本地的 Git 文件一直报错,发现 Github 把默认分支 master 改名成了 main,delete + add Repository 好几遍才发现问题在于我的本地文件夹不是通过 clone 创建的,需要指定 --allow-unrelated-histories。我很好奇难道我之前没这样干过嘛,居然今天才发现这个问题。顺便如果不希望使用 main 作为分支名,可以通过 https://github.com/settings/repositories 更新。