按照Github的教程 Adding a local repository to GitHub using Git 1. 创建空的Github仓库 创建远程仓库 ,注意不要勾选Add a README file,如果勾选会生成一笔提交,如果本地仓库也提交了代码,会导致拉取/推送代码失败. 2. 切换到本地环境,初始化仓库 $ git init -b main 3. 添加本地文件并提交 $ git add . # Adds the files in the local repository and…