Eclipse+github+“hello world”

Eclipse+github+“hello world”

一、安装GIT插件EGit
点击Help中的Install New Software
Eclipse+github+“hello world”

出现如下界面,并点击Add
Eclipse+github+“hello world”

出现并编辑成如图方框后,点击OK
Eclipse+github+“hello world”

勾选这三个后,点击Next,等待安装
Eclipse+github+“hello world”

之后一直点击Next,勾选同意协议后,最后点击Finish,继续安装后重启Eclipse
二、配置EGit
Windows->preferences->Team->Git->Configuration,再点击And Entry
Eclipse+github+“hello world”

再如图输入自己在github的用户名和绑定的邮箱
Eclipse+github+“hello world”

三、新建项目,并将代码提交到本地的GIT仓库中

1.File->Project->Java->Java Project或File->Java Project,再输入项目名称,如图
Eclipse+github+“hello world”

File->New->package,在弹出框的Name一行输入包的名称
Eclipse+github+“hello world”

在如图中新建一个类,N右键单击->New->class
Eclipse+github+“hello world”

命名类后得到
Eclipse+github+“hello world”

编辑hello world代码
Eclipse+github+“hello world”

右键点击项目->Team->Share Project,创建GIT仓库
Eclipse+github+“hello world”

右键点击项目->Team->Commit Message,将代码提交到本地仓库
Eclipse+github+“hello world”

在github上创建仓库
Eclipse+github+“hello world”

右键点击->Team->Remote->Push
Eclipse+github+“hello world”

之后输入自己的远程仓库地址,再如图输入后点击Finish
Eclipse+github+“hello world”

最后成功提交
Eclipse+github+“hello world”