GIt生成ssh**

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

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

GIt生成ssh**

此时,

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

GIt生成ssh**

请勿删除!


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

不需要设置名称与密码
GIt生成ssh**

 

cat ~/.ssh/id_rsa.pub

查看公钥

GIt生成ssh**

 

 

路径是C:\Users\Administrator\.ssh

GIt生成ssh**

GitLab添加公钥
GIt生成ssh**

GIt生成ssh**

GIt生成ssh**

 

GIt生成ssh**

 

 ssh -T [email protected]

测试配置文件是否正常工作

GIt生成ssh**

 

git clone [email protected]:root/TestProject_1.git

拉项目到本地

GIt生成ssh**

cd TestProject_1

进入项目

GIt生成ssh**

 来自https://www.cnblogs.com/yjlch1016/p/9692840.html