Git生成SSH秘钥

Git生成SSH密钥

//配置用户名
git config --global user.name "yangjianliang"

//配置邮箱
git config --global user.email "[email protected]"

此时,

会在C:\Users\Administrator目录下生成.gitconfig配置文件:

请勿删除!

//生成公钥和私钥,按3次Enter
ssh-keygen -t rsa -C "[email protected]"

不需要设置名称与密码

//查看公钥
cat ~/.ssh/id_rsa.pub

扫描二维码关注公众号,回复: 10901715 查看本文章

路径是C:\Users\Administrator\.ssh
GitLab添加公钥

GitLab添加公钥

 

 

//测试配置文件是否正常工作 
ssh -T [email protected]

//拉项目到本地
git clone [email protected]:root/TestProject_1.git

本文转载地址:https://www.cnblogs.com/yjlch1016/p/9692840.html 

发布了27 篇原创文章 · 获赞 25 · 访问量 12万+

猜你喜欢

转载自blog.csdn.net/weixin_38293850/article/details/105402381