Git配置SSH公钥
第一步:首先下载安装git:https://git-scm.com/downloads/
第二步:一路默认,安装完成后,打开文件夹C:\Users\Administrator\.ssh(Administrator是当前用户名),在空白处点鼠标右键选择“Git Bush Here” ,打开gitbush。
配置用户名和邮箱:
$ git config --global user.name "your_name"
$ git config --global user.email "your_email@example.com"
第三步:生成密钥对:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
第四步:此时文件夹会生成两个密钥文件:
第五步:打开id_rsa.pub,将文件内容全选复制,准备粘贴到github上:
第六步: 登陆github,点击右上角头像,选择Settings,选择SSH and GPG keys:
第七步:点击“New SSH key”,将复制的密钥内容粘贴进Key的输入框,Title随便取:
第八步:回到gitbush,测试输入: ssh -T git@github.com