git ssh配置
在MAC下配置git
总结一下:
1)cd ~/.ssh
2)ssh-keygen -t rsa -C watalou@126.com (在执行这一步之前,如果之前存在同名的key,最好备份一下:mkdir key_backup; mv id_rsa* key_backup)
3)$ ssh-keygen -t rsa -C jiang.bo.hit@gmail.com //改成自己的email
4) 登录到GitHub页面,Account Settings->SSH Public Keys->Add another key
将生成的key(id_rsa.pub文件)内容copy到输入框中,保存。
5)测试:$ ssh git@github.com
如果一切正常,应该类似于如下信息:
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
PTY allocation request failed on channel 0
Hi jiang-bo! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
6)设置个人信息:
$ git config --global user.name "Bo Jiang" //此处我设置的是自己在github上的用户名
$ git config --global user.email "jiang.bo.hit@gmail.com" //此处输入注册时使用的邮件地址