优达学城使用git教程:
https://cn.udacity.com/course/how-to-use-git-and-github--ud775
第一次用git将本地文件上传到github步骤:
在当前文件夹上右键,选择git bush here
git init,因为我输了两次所以是再次初始化
ssh-keygen -t rsa -C"你的email地址"
三次回车生成ssh key
进入c盘的C:\Users\标准用户\.ssh(一般都是在这个文加下)生成了两个文件,用记事本打开id_rsa.pub,全部复制
在github里点击右上角账号头像的“▼”→Settings→SSH kyes→Add SSH key。
Title自定义,将复制的内容粘贴到下面的文本框
测试ssh key配置是否成功
$ ssh -T git@github.com
The authenticity of host 'github.com (192.30.252.129)' can't be established.
RSA key fingerprint is 16:27:xx:xx:xx:xx:xx:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes #确认你是否继续联系,输入yes
Warning: Permanently added 'github.com,192.30.252.129' (RSA) to the list of known hosts.
Enter passphrase for key '/c/Users/xxxx_000/.ssh/id_rsa': #生成ssh kye是密码为空则无此项,若设置有密码则有此项且,输入生成ssh key时设置的密码即可。
Hi xxx! You've successfully authenticated, but GitHub does not provide shell access. #出现词句话,说明设置成功。
$ git add.上传当前文件夹的所有文件
$ git commit -m "add hello.md" #提交记录说明
$ git remote add origin ‘粘贴复制github上test ssh key的ssh路径’ #
$ git push -u origin master
刷新test ssh key仓库
参考百度教程:
https://jingyan.baidu.com/article/a65957f4e91ccf24e77f9b11.html