cike0415 发表于 2018-1-12 16:13:23

创建SSH keys

1、检查是否已经有SSH Key存在
  windows:
  

type "%userprofile%\.ssh\id_rsa.pub"  

  

  Linux:
  

cat ~/.ssh/id_rsa.pub  

  如果存在,则进入第3步。

2、创建SSH keys
  windows需要在git虚拟环境中运行,如果提示ssh-keygen,则先安装git,地址:
  http://git-scm.com/download/win
  如果很慢可以去百度盘下载:http://pan.baidu.com/s/1c2xd1ss
  然后在任意文件夹下面点鼠标右键,选择 Git Bash Here
https://images2015.cnblogs.com/blog/357235/201701/357235-20170118202556328-931618421.png
  

ssh-keygen -t rsa -C "GitLab" -b 4096  

  linux无需安装,直接执行上面指令
  全部默认值,回车

3、将SSH Key添加到git账号中
  windiws运行下面指令会把公钥复制到剪贴板,然后粘贴到gitlab的user profile里面即可。
  

type "%userprofile%\.ssh\id_rsa.pub" | clip  

  linux运行之后再手动复制:
  

cat ~/.ssh/id_rsa.pub  
页: [1]
查看完整版本: 创建SSH keys