Git src refspec does not match any error

Cloning a branch of a git repository (particularly non master ones) and then pushing your changes to the same can result into this error

error: src refspec <branch-name> does not match any.
error: failed to push some refs to 'https://github.com/xxxxxx/yyyy.git'

Resolve src refspec does not match any error

This error can be resolved by pushing using following command

git push origin HEAD:<branch-name>

where <branch-name> is the name of the branch you are pushing to.

Leave a Reply

Your email address will not be published. Required fields are marked *