mbp配置github,在网上找了几个都是复制来复制去,不行,自己还是去看官方文档。
1、安装客户端(https://mac.github.com/),这里跟其他系统的区别是安装了没有.ssh文件。所以要生成这个文件。输入命令
ssh-keygen -t rsa -C "your_email@example.com"
然后生成了.ssh文件。
2、添加新key到ssh-agent
# start the ssh-agent in the background eval "$(ssh-agent -s)" # Agent pid 59566 ssh-add ~/.ssh/id_rsa3、添加sshkey到你的账户pbcopy < ~/.ssh/id_rsa.pub(将你的公钥复制到剪贴板,然后在网站上添加到sshkey)
4、测试官方链接:https://help.github.com/articles/generating-ssh-keys/输入:ssh -T 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,看见Hi username! You've successfully authenticated, but GitHub does not # provide shell access.,这样就成功了!