通过SSH简化远程连接github

创建SSH密钥

打开Git Bash,输入
ssh-keygen -t rsa -C 邮箱地址
回车三次,密钥生成。
下图为文件所在文件夹。id_rsa为私钥,id_rsa.pub为公钥。
image
在文件目录下输入cat id_rsa.pub查看文件
image
复制密钥

在github添加SSH公钥

在github中进去setting → SSH and GPG keys
image
点击添加新的SSH key,如图所示
image

通过SSH克隆远程仓库

在github中复制SSH链接
image
在git bash中输入git clone SSH链接
image

posted @ 2023-01-30 16:55  Instser  阅读(52)  评论(0)    收藏  举报