github ssh

设置git的user name 和 email

$ git config --global user.name "YOURNAME"

$ git config --global user.email "YOUREMAIL"

生成SSH

先看看是否存在~/.ssh 如果有则先备份删除

$ ssh-keygen -t rsa -C"描述信息"

接着按三个回车

最后在~/.ssh/ 底下会有有两个文件  id_rsa 和 id_rsa.pub

将.pub里的内容拷贝

在github网站的setting->ssh设置里 添加一个密钥,将刚刚拷贝的内容贴到这里面

回到控制台进行测试

$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
Warning: Permanently added ‘github.com,207.97.227.239′ (RSA) to the list of known hosts.
ERROR: Hi tekkub! You’ve successfully authenticated, but GitHub does not provide shell access
Connection to github.com closed.

如果看到以上信息,就说明你的key已经成功链接

如果你在git clone 或者 git push的时候弹出类似  unable to access ' xxxx': Server aborted the SSL handshake 的错误 不妨 试试将url的源换一下,见:

https://help.github.com/articles/changing-a-remote-s-url/


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值