GitHub Err (1)error: src refspec main does not match any

GitHub Err (1)error: src refspec main does not match any

报错

$ git push -u origin main error: src refspec main does not match any error: failed to push some refs to 'github.com:genghenggao/niuniu.git

分析

  • 发现现在建的 github 工程默认名为了 main

解决

  • 统一远程和本地的仓库名称即可
把本地的 master 仓库名称修改为远端的 main
git branch -m master main
notion image