GIT – error: src refspec master does not match any

image_pdfimage_print

Em geral este erro acontece porque está se tentando efetuar o push antes de fazer um commit num repositório novo.

Exemplo:

1
2
3
4
5
mkdir repo && cd repo
git remote add origin /path/to/origin.git
git add
git push -u origin master
error: src refspec master does not match any.

Então:

1
2
git commit -m 'initial commit'
git push origin master

E possivelmente o problema foi resolvido!

Gostou? Tire um minutinho e dê sua contribuição para Drall Dev Community no Patreon!