不废话了,直接上代码
1.任意位置打开git bash
2.ssh-keygen -t rsa -b 4096 -C "这里是自己的git邮箱地址"
3.Generating public/private rsa key pair.
4.Enter file in which to save the key (/c/Users/CAI/.ssh/id_rsa): //按enter键
5.Created directory '/c/Users/CAI/.ssh'. //默认保存在c盘里面,后缀名是.ssh
6.Enter passphrase (empty for no passphrase): //输入你的git邮箱密码
7.Enter same passphrase again: //再输入一次
8.生成SSH密钥完毕
9.eval $(ssh-agent -s) //判断ssh-agent是否在运行,出现Agent pid 145(端口号)表示已经运行中
10.ssh-add ~/.ssh/id_rsa
11.Enter passphrase for /c/Users/CAI/.ssh/id_rsa: //输入你的git邮箱密码
12.Identity added: /c/Users/CAI/.ssh/id_rsa (git邮箱地址) //这里已经完成了,希望可以帮助到你
网友评论