1.配置用户信息
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"
查看配置是否成功 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) 输入密码(空表示没有密码)
3.复制密钥
找到存放密钥的文件夹 ,默认为C:\Users\Administrator.ssh,打开后复制
4.gitlab上配置ssh密钥
点击添加即可