こちらのUdemyの講座を受講している際、タイトルのようなエラーに遭遇しました。
https://www.udemy.com/course/intro_git/learn/lecture/6449730#notes
(3分29秒)
ys@mbp intro_git % git push origin master
↓
error: src refspec master does not match any
error: failed to push some refs to 'github.com:〇〇(GitHubのユーザー名)/intro_git.git'
結論
git push origin master ではなく
git push origin main を使う
ys@mbp intro_git % git push origin main
↓
Enumerating objects: 19, done.
Counting objects: 100% (19/19), done.
Delta compression using up to 8 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (17/17), 1.66 KiB | 567.00 KiB/s, done.
Total 17 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (4/4), done.
To github.com:〇〇(GitHubのユーザー名)/intro_git.git
4817446..7f3dadd main -> main