Klónozom a tárolómat:
git clone ssh://xxxxx/xx.git
De miután megváltoztattam néhány fájlt, és add
és commit
őket, szeretném őket a szerverre tolni:
git add xxx.php
git commit -m "TEST"
git push origin master
De a hiba, amit visszakapok a következő:
error: src refspec master does not match any.
error: failed to push some refs to 'ssh://xxxxx.com/project.git'
Talán csak el kell kötelezned magad. Én is belefutottam ebbe, amikor ezt tettem:
mkdir repo && cd repo
git remote add origin /path/to/origin.git
git add .
Hoppá! Soha nem követtem el!
git push -u origin master
error: src refspec master does not match any.
Csak annyit kellett tennem:
git commit -m "initial commit"
git push origin master
Sikerült!
Próbáld ki a git show-ref
-t, hogy megnézd, milyen ref-jeid vannak. Van refs/heads/master
?
Megpróbálhatod a git push origin HEAD:master
-t, mint a helyi referenciáktól függetlenebb megoldást. Ez kifejezetten kimondja, hogy a helyi ref HEAD
-t a távoli ref master
-re akarod tolni (lásd a git-push refspec dokumentációt).