インフラ系SEの技術メモ

雑なエンジニアが低信頼性のメモを書いています。参考程度にとどめてください。

(Git)git pushするも 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 'https://github.com.git'

原因

以下を忘れてた。

$ git branch -M main

それをするとパスワードが聞かれて成功しました。

$ git push -u origin main
Username for 'https://github.com':
Password for 'xx..
Enumerating objects: 3, done.
...