症状
新しいリポジトリを作成し、ローカルのフォルダをpushしようとしたら、下記のエラーが発生しましたerror
git init
Initialized empty Git repository in hoge/.git/
git commit -m "first commit"
On branch master
Initial commit
nothing to commit (create/copy files and use "git add" to track)
git branch -M main
git remote add origin https://github.com/TKWebSE/BookOfAtCoderBeginning.git
git push -u origin main
error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/hoge.git'
解決策
フォルダの中身が空っぽで、ファイルがなかったたので、ファイルを作って再度addとcommitしたら、pushできました空ファイルさくせ
git add -A
git commit -m "hoge"
git push -u origin main
参考