1.注册github账户
2.egit插件
检查egit插件依次打开help-About Eclipse
依次打开window-preferences-Team
如果没有自己安装
在菜单栏依次打开help-install new software
add http://download.eclipse.org/egit/updates/ 进行下载。下载完成后会提示重启eclipse
3.配置git
依次打开Window - Preferences - Team -Git -Configuration
点击Add Entry,添加name和email
4.在Eclipse中生public key, 并添加到GitHub Repository中。
在菜单栏依次打开window - preference -general - network connection - SSH2 -Key Management .点击generate RSA Key生成key ,点击Apply 保存并应用key。
打开github 登录点击Your profile
Edit profile
把上面生成的 public key 拷贝到这里.点击Add Key
5.上传项目
选定项目-右键-Team-Share project-git
勾选 Use or create repository in parent folder of project,选中要发布的项目,点击Create Repository,点击Finish完成。
登录GitHub 点击New repository按钮添加项目代码仓库。
输入Repository name Description ,选Public(Private要收费,Public免费,不过相应的所发布的项目代码任何人都可以查看得到),最后点击Create repository,项目代码仓库创建完毕。
鼠标选中要发布的项目,单击右键,Team - Commit,填写Commit message,勾选全选,点击Commit提交。注意:此时,仅是提交在本地Git,点击CommitPush才能提交到GitHub中
发布到GitHub。鼠标选中要发布的项目,单击右键,Team - Remote - Push,粘贴URI,填写User和Password,点击Next;
点击Source ref的下拉框,选择mast,点击Add Spec,点击Finish,点击OK完成
6.更新项目
鼠标选中要更新的项目,单击右键,Team - Commit,填写Commit message,勾选更新的文件,点击CommitPush。