git初级教程

2019-01-11  本文已影响0人  ssuzj

如何使用Git将代码更新到本地

第一步 -- 新建仓库

第二步 -- clone项目

$ git clone git@github.com:xiangbajiang/MyBlog.git

$ git clone git@github.com:xiangbajiang/MyBlog.git
Cloning into 'MyBlog'...
The authenticity of host 'github.com (52.74.223.119)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,52.74.223.119' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$ ssh-keygen -t rsa -b 4096 -C ''xiangbajiang@gmail.com''

在生成过程中,一直按回车直到密钥生成就可以
密钥会生成再家目录下的~/.ssh/下,公钥是id_rsa.pub(给别人使,也就是github),私钥是id_rsa(自己用)

$ cat ~/.ssh/id_rsa.pub

image.png
image.png
上一篇 下一篇

猜你喜欢

热点阅读