a blog for those who code

Tuesday 8 July 2014

Error when "git push" : src refspec test does not match any

You might be getting and error like...

error : src refspec test does not match any.
fatal : The remote end hung up unexpectedly
error : failed to push some refs to 'git@github.com: {username}/{projectname}.git'
So, In this post we will try to fix this error, we have some solution regarding 'error : src refspec test does not match any'. So, lets list down the solutions..

Solution 1 :

At first just try to commit all the files before pushing it into the github. This error will come when you haven't committed the files and tried to push to the github.

If this also doesn't worked out for you, lets move to 2nd solution.

Solution 2 :

If you are working with branches and getting this error then might be you are not refrencing to the correct branch. Refspec are always in the form source:destination, so the error is telling you that might be something is wrong with your source part. If you are doing a spelling mistake or changing the case of the branch, you will get this error because branch names are case-sensitive.

Solution 3 :

If above two solution doesn't worked for you then you can try using :

git push origin HEAD:master
OR
git push origin "your_git_repo":"your_branch_name"
OR
git push origin master --force

So these three solution will surely make your "git push" work but if it doesn't just check that you are trying to push a specific branch in local to a specific branch in remote. This error will also come when you are in a specific branch and try to push another that do not exist yet.

Please Like and Share the Blog, if you find it interesting and helpful.

14 comments:

  1. Wohh precisely what I was searching for, thank you for posting.

    ReplyDelete
  2. I like this internet site because so much useful material on here :D.

    ReplyDelete
  3. I really enjoy examining on this website, it contains excellent posts.

    ReplyDelete
  4. Very good article. I'm facing many of these issues as well..

    ReplyDelete
  5. Some truly rattling work on behalf of the owner of this website, utterly great content.

    ReplyDelete
  6. I like this internet site because so much useful stuff on here :
    D.

    ReplyDelete
  7. For hottest news you have to visit world wide web and on the
    web I found this web site as a most excellent web page for latest
    updates.

    ReplyDelete
  8. Thanks a lot for being my own mentor on this matter.
    I enjoyed the article very much and most of all enjoyed
    reading how you handled the issues I widely known as controversial.
    You happen to be always very kind to readers really like me and let
    me in my lifestyle. Thank you.

    ReplyDelete
  9. Hi, i think that i saw you visited my site so i came
    to ?return the favor?.I'm trying to find things to enhance my site!I suppose
    its ok to use some of your ideas!!

    ReplyDelete
  10. hello there and thank you for your info ?
    I have certainly picked up something new from right here.
    I did however expertise several technical points using this website, since I experienced to reload the website lots of times previous to I could get it to load correctly.
    I had been wondering if your hosting is OK? Not that I'm complaining, but sluggish loading instances times will sometimes affect your placement
    in google and could damage your high-quality score
    if ads and marketing with Adwords. Anyway I'm adding
    this RSS to my e-mail and can look out for much more of your respective
    interesting content. Ensure that you update this again very soon.

    ReplyDelete
  11. I definitely wanted to develop a simple word so as to thank you for those splendid tips
    you are showing here. My long internet investigation has at the
    end of the day been paid with good knowledge to write about with my friends and classmates.
    I would repeat that most of us website visitors actually are quite fortunate to exist in a wonderful site with very many special people with valuable tricks.

    I feel very grateful to have seen your weblog and look forward to plenty
    of more brilliant times reading here. Thanks a lot
    once again for everything.

    ReplyDelete
  12. Hi, Neat post. There's a problem with your website in internet explorer, could check this?
    IE nonetheless is the market chief and a huge section of other
    people will leave out your great writing due to this problem.

    ReplyDelete
  13. I'm still learning from you, but I'm making my way to the top as well.
    I definitely enjoy reading everything that is written on your website.Keep the aarticles coming.

    I loved it!

    ReplyDelete
  14. Respect to article author, some wonderful selective information.

    ReplyDelete