配置SSH Key和账号、邮箱信息
我们选择使用SSH方式来管理代码,由于本地Git仓库和GitHub仓库之间的传输是通过SSH加密的,所以必须要让github仓库认证你SSH key,在此之前,必须要生成SSH key。
任意位置右键—点击“Git Bash Here”,输入:
ssh-keygen -t rsa -C '1410475107@qq.com'
其中-t指定密钥类型,这里设置rsa即可,-c是密钥的注释,这里设置成邮箱方便分辨;
一路回车即可;

- 配置用户名和邮箱:
- git config --global user.name "1410475107"
- git config --global user.email "1410475107@qq.com"

The email is only optional field to identify the key.邮箱仅仅是识别用的key
When you create the ssh you type (for example):当你创建ssh的时候
ssh-keygen -t rsa -C “any comment can be here”
-t = The type of the key to generate 密钥的类型
-C = comment to identify the key 用于识别这个密钥的注释
So the Comment is for you only and you can put anything inside.
Many sites and software are using this comment as the key name.
所以这个注释你可以输入任何内容,很多网站和软件用这个注释作为密钥的名字
本文详细介绍了如何在GitHub上配置SSH Key,包括生成RSA密钥、设置邮箱注释以及配置用户名和邮箱。重点讲解了SSH-keygen中邮箱注释的作用,适合Git初学者和开发者阅读。
9997

被折叠的 条评论
为什么被折叠?



