FWIW, ran into same error, but believe it came about due to the following sequence of events:
master
branch.dev
branch, which was defined as the default branch, in conjunction with permissions added to the master
branch preventing changes without a pull request.Then, when attempting to push changes from the local to the remote, received error "src refspec master does not match any", or when attempting to push to dev
, "src refspec dev does not match any".
Because changes were pending in the local clone, I did not want to blast it and refresh.
So, fixed the issue by renaming the local branch to dev
...
$ git branch -m dev
...followed by the normal push of git push origin dev
, which worked this time without throwing the aforementioned error.