Eclipse+Github+“hello world”(简单清楚)
文章目录
下载链接
-
Eclipse下载及安装:Eclipse Downloads | The Eclipse Foundation
-
Github账号注册:GitHub
-
Github客户端下载:GitHub Desktop | Simple collaboration from your desktop
安装
Github仓库
创建一个GitHub仓库
- 点击
Create a new repository
取一个项目名,点击Create repository
,仓库建立完毕
GitHub客户端
登录,选择你的仓库并克隆仓库到本地
记一下仓库的local path
,后面要用到
Eclipse
安装EGit插件
插件地址:http://download.eclipse.org/egit/updates
-
Help
->Install New Software...
->Add
-
输入地址到Location
-
全选安装,重启Eclipse
-
Windows
->Preferences
->Version Control(Team)
->Git
->Configuration
->Add Entry
-
添加自己的GitHub邮箱、用户名,
Apply and Close
创建hello world代码
-
创建一个Java的project
-
取一个名字,
finish
-
创建一个class
-
取一个名字,
finish
-
hello world代码
public class helloworld { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("hello"); } }
创建本地仓库
1.Team
->Share progect
- 如图->
finish
Team
->Commit
- 将需要提交文件加入Index
- 在Commit Message随便写一点修改了什么,然后提交
push到GitHub的仓库
1.Team
->Remote
->Push
2.用之前的Local Path(就是克隆到本地的GitHub仓库)填入
3.
由GitHub上传
- 修改情况已经能从GitHub客户端查看
- 点击
Publish branch
上传 - GitHub上就有上传的代码啦