git本地新建仓库并推送到远程

$ git init
$ git add README.md
$ git commit -m "first commit"
$ git remote add origin https://github.com/bi-an/stl-source.git
$ git push -u origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/xxx/xxxx.git'

针对最后一步出现的错误,把git remote add origin https://xxxx.git改成下面:

$ git remote set-url origin https://github.com/xxx/xxxx.git

重新push即可

你可能感兴趣的:(Git)