Eclipse 连接 Github 报错,不能提交和克隆项目解决方案
注册 GitHub 账号
GitHub 官方网址: https://www.github.com 自己注册一个账号。
新建 public 版本仓库
根据自己需求创建仓库( public 是免费的,而 private 大多是收费的):
-
进入管理页面 :  -
仓库管理页面 :  -
新建版本仓库 :  -
建库成功后的页面 :  -
生成本地仓库秘钥 5.1 查看生成秘钥后存放位置  5.2 创建本地秘钥 使用 Eclipse 生成本地秘钥文件 window->preference->general->network connections->ssh2->点击 Generate RSA KEY->点击 Save private key 生成并保存本地密匙:  生成后的秘钥文件如下:  其中 id_rsa.pub 是公匙秘钥,需要添加到 GitHub 的秘钥库中。 5.3 GitHub 添加秘钥   在 title 中输入密匙名称(自定义),在 key 文本域中输入 id_rsa.pub 文件中的内容。并确认新增密匙。  添加成功 
Eclipse 安装 EGIT 插件及设置参数
- 插件地址: http://download.eclipse.org/egit/updates/



- EGIT 插件参数配置
进入 Eclipse 配置面板(Window->Preferences ) 常用 参数有 下述 4 个: http.sslVerify=false(必填) 关闭 ssl 校验。 http.sslVersion=tlsv1.2 定义 ssl 协议版本,Github 在最近的更新中关闭了 tlsv1.0 和 tlsv1.1协议的访问,不提供此参数无法访问 Github 远程版本仓库 ( JDK1.8 已经默认 tlsv1.2 ,可以不配置) 。 user.email=xxx@xxx(必填) user.name=xxx(必填) 在访问 Github 远程版本仓库的时候,Github 要求必须提供用户和电子邮箱  完成后: 
连接远程版本仓库
- 分享项目,创建本地仓库
  - 连接远程仓库(连接 GitHub)
2.1   2.2 在浏览器上登录自己的 GitHub 账号,查询自己的仓库信息,复制连接信息。如下:  2.3 填写仓库信息  2.4 一直点 Preview ,直到出现这个界面:点击 Push  完成操作! 过一段时间,可能几秒钟,也可能几分钟,也有可能几十分钟,就可以去网上自己的版本仓库里查看上传的项目内容信息。
注意问题小结
1、连接信息采用 Https ,我的 Eclipse 不能连接。目前不清楚原因。这个问题困扰了我好几天。只能采用 SSH 的连接信息。 注意 : https : 连接信息,user 是 git,不要换成自己的用户名。 SSH : 连接信息, user 是自己的账户名。 这两个不一样。要注意!
|