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

git config --global user.email "526861348@qq.com"
配置邮箱

Git生成SSH密钥

此时,

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

Git生成SSH密钥

请勿删除!


ssh-keygen -t rsa -C "526861348@qq.com"
生成公钥和私钥
按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 git@192.168.1.105

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

Git生成SSH密钥

 

git clone git@192.168.1.105:root/TestProject_1.git

拉项目到本地

Git生成SSH密钥

cd TestProject_1

进入项目

Git生成SSH密钥

 

相关文章:

  • 2021-04-27
  • 2021-08-25
  • 2021-07-09
  • 2021-05-18
  • 2021-05-26
  • 2022-02-22
  • 2021-06-17
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2021-09-18
  • 2021-10-21
  • 2022-12-23
相关资源
相似解决方案