Git配置SSH链接(GitHub配置 公钥/私钥)

创建 .ssh文件夹:

首先配置用户

$ git config --global user.name "xxx"

$ git config --global user.email "[email protected]" 

然后生成ssh秘钥

$ ssh-keygen -t rsa -C "your [email protected]"

之后大概需要三次回车即可, 然后会出来提示Enter file in which to save the key 后面是一个路经,就是.ssh文件夹了。

配置SSH链接

 一般 .ssh文件在 C:\Users\user.name\.ssh  

1. 打开id_pub 复制里面的内容。

2. 打开github setting (见上图) 在Key里面粘贴刚才复制的内容。自此完成。

3. 测试一下,git bash输入: ssh -T [email protected]  这时会问是否继续连接,我们输入 yes,这样,我们的git配置就完成了。

猜你喜欢

转载自blog.csdn.net/Mrceel/article/details/85991017