error: src refspec master does not match any github git commit error

I got this error when I was trying to push the changes to the remote server. It says the following on the command line where you can see how that error is going on.

error: src refspec master does not match any.
error: failed to push some refs to 'ssh://xxxxx.com/project.git'

This means you are missing the commit on local branch first. You should do that and then proceed with the remote commit.

Follow the steps like this while doing the git workflow.

git init
touch README.md
git commit -m "update"
git remote add origin /path/to/origin.git
git add .
git commit -m 'second update'
git push origin master


That's it. It's the commit that you need to do before pushing. If you do the commit first as show in the steps, you will see that it works just fine.