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