src refspec master does not match any : failed to push some refs

Thursday, 7. February 2013

I have had this error after moving repository to another account. There are various factors that may cause such problem but since I was sure our git framework covered all the basics, i was a little suprised as to why I keep having this issue.

error: src refspec master does not match any.
error: failed to push some refs to '/path/repo.git'

After a bit of cross referencing, I indeed notice the head information was not being created when we initiated repository under the new account under (your_repo.git/refs/heads)

In the end it turned out the issue was simply because there was no user details registered in git config for the account we were currently using. So afterall the frameworks was not covering all the basics by the looks of things!! :)

Anyway, to solve it.. simply add the following basic details and you will be sorted

git config --global "YOUR NAME"
git config --global "YOUR EMAIL"

Leave a Reply

You must be logged in to post a comment.