if I use this:
git remote add origin user@example.com:/home/user/www/example.git
git push开发者_开发百科 origin master
I got this error:
error: src refspec master does not match any.
error: failed to push some refs to 'user@example.com:/home/user/www/example.git'
Default behaviour of git push is just to push "matching refs", i.e. branches which are present both in the local and the remote repository. In your example, there are no such branches, so you need to tell git push which branches to push explicitly, i.e. via
git push origin branch-to-be-pushed
or, if you want to push all branches,
git push --all origin
精彩评论