Svojo shrambo sem kloniral z:
git clone ssh://xxxxx/xx.git
Toda ko spremenim nekaj datotek in jih pridam
ter odpovem
, jih želim poslati na strežnik:
git add xxx.php
git commit -m "TEST"
git push origin master
Toda napaka, ki jo dobim nazaj, je:
error: src refspec master does not match any.
error: failed to push some refs to 'ssh://xxxxx.com/project.git'
Morda se morate le zavezati. S tem sem se srečal, ko sem to storil:
mkdir repo && cd repo
git remote add origin /path/to/origin.git
git add .
Ups! Nikoli ni bilo storjeno!
git push -u origin master
error: src refspec master does not match any.
Vse, kar sem moral storiti, je bilo:
git commit -m "initial commit"
git push origin master
Uspeh!
Poskusite git show-ref
, da vidite, katere reference imate. Ali obstaja refs/heads/master
?
Lahko poskusite z git push origin HEAD:master
kot bolj od lokalnih referenc neodvisno rešitev. Ta izrecno navaja, da želite lokalni ref HEAD
potisniti v oddaljeni ref master
(glejte dokumentacijo git-push refspec).