解决git push时the requested upstream branch 'origin/main' does not exist
背景
本地文件夹未关联远程仓库, 在 github 新建仓库后,远程仓库也有文件
本地仓库关联远程仓库
git branch --set-upstream-to=origin/main master
会出现
解决流程
git remote add origin 远程仓库地址
git pull origin master --allow-unrelated-histories
git branch --set-upstream-to=origin/main master
git push
解决git push时the requested upstream branch 'origin/main' does not exist
https://mariana-yui.github.io/2021/06/29/2021-06-29-git-branch-set-up-stream/