Thursday, 17 November 2016

git, github error: error: src refspec head does not match any. error: failed to push some refs to 'https://github.com/xxx.git

I got below error recently when i was pushing my code to github.

error: src refspec head does not match any.
error: failed to push some refs to 'https://github.com/xxx.git



Solution.

First my project is not a new and empty project.

only just one line of code solved it:


git push origin HEAD:master


because somehow your git is using wrong ref for head.



Or

use

git push origin master

don't use git push origin head

No comments:

Post a comment