程序员新电脑必备软件安装教程 · 第二弹:GitLab配置SSH密钥

92 阅读1分钟

1.配置用户信息

git config --global user.name "你的名字"

image.png

git config --global user.email "你的邮箱"

image.png

查看配置是否成功 git config --global --list

2.生成密钥

终端 或 右键文件夹open git bash here

输入命令 ssh-keygen -t rsa -C '随意(生成SSH 密钥的标题)'

注:Enter file in which to save the key 可以写存放ssh密钥的路径 Enter passphrase (empty for no passphrase) 输入密码(空表示没有密码)

image.png 3.复制密钥 找到存放密钥的文件夹 ,默认为C:\Users\Administrator.ssh,打开后复制 4.gitlab上配置ssh密钥

image.png

image.png 点击添加即可