[git] Message 'src refspec master does not match any' when pushing commits in Git

I ran into the same snag..and the solution was to push the code to the repo as though it were an existing project and not a brand new one being initialised.

git remote add origin https://github.com/Name/reponame.git
git branch -M main
git push -u origin main