$ git push -u origin master
error: src refspec master does not match any.
error: failed to push some refs to 'git@github.com:accompanyling/learngit.git'
$ ssh-keygen -t rsa -C "332138725@qq.com"
该命令行会在C:UsersAdministrator中生成.ssh文件夹。里面有id_rsa和id_rsa.pub文件。
打开github设置key 将上面复制的内容粘贴在New SSHKey->key中
最后我的做法是把之前在本机上建立的版本库全部删掉,从新建立:
$ mkdir learngit
$ cd learngit
$ pwd
第二步,通过git init命令把这个目录变成Git可以管理的工具
$ git init
git add readme.txt
第五步,用命令git commit -m"(里面是提交说明)",把文件交到仓库
$ git commit -m "wrote a readme file"
第一,在github上创建一个新仓库,名字也为learngit
$ git remote add origin git@github.com:accompanyling/learngit.git
$ git push -u origin master
https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/0013752340242354807e192f02a44359908df8a5643103a000
https://blog.csdn.net/huahua78/article/details/52330792