git_2

接着上次学

解决Warning: Permanently added the RSA host key for IP address ‘13.250.177.223’ to the list of known hosts.

指路:https://blog.****.net/weixin_37242696/article/details/80736484

添加远程库

由于本地git仓库和github仓库之间的传输是ssh加密的,所以在电脑上需要
创建SSH Key
C:\Users\DELL.ssh,看这个目录下有无id_rsa和id_rsa.pub这两个文件,这俩文件是秘钥,前者私钥,后者是公钥。没有的话,打开git bash,
输入 ssh-****** -t rsa -C “[email protected]
登陆GitHub,打开“Account settings”,“SSH Keys”页面
git_2
点“newSSH Key”

把公钥内容用notepad++打开并复制,title随便起git_2

在本地库下运行命令(上篇有写)在本地关联远程库:
git remote add origin[email protected]:你的用户名/github仓库名.git
git默认远程库的名字是origin 本地库的所有内容推送到远程库中把当前分支master推送到远程。
命令:git push -u origin master,
以后,本地git commit提交后,就可以通过命令:git push origin master

从远程库克隆

git clone 链接,建议使用ssh协议,速度最快。
**即使这样下载也比较慢,甚至下载老中断,借鉴了一个大佬的方法,:**https://blog.****.net/xy_zhangchn/article/details/81558144,从Github克隆到码云文件大时会特别慢,多等一会,上次我就等了差不多半小时,导入码云之后,git bash命令 :git、 clone <从码云那复制的地址>,几秒就好。