I have tried to follow the solutions suggested in this post but it didnt work and I am still getting: src refspec master does not match any.
Here is what I did: Fo
For a new repository, the method works for me:
Remote the files related with git
rm -rf .git
Do the commit again
git add . && git commit -m "your commit"
Add the git URL and try to push again
git remote add origin
And then try to push again
git push -u origin master -f
Success!
Since it's a new repository, so it doesn't matter for me to remove the git and add it again.