Eclipse+Github+“hello world“(简单清楚)

Eclipse+Github+“hello world”(简单清楚)

下载链接

安装

  1. jdkEclipseGithub客户端下载下来
  2. 全默认无脑下一步安装完成

Github仓库

创建一个GitHub仓库

  1. 点击Create a new repository

取一个项目名点击Create repository,仓库建立完毕

image-20210925161159289

GitHub客户端

登录,选择你的仓库并克隆仓库到本地

image-20210925162053486

记一下仓库的local path,后面要用到

image-20210925162158590

Eclipse

安装EGit插件

插件地址http://download.eclipse.org/egit/updates

  1. Help->Install New Software...->Add

  2. 输入地址到Locationimage-20210925163019554

  3. 全选安装,重启Eclipse

  4. Windows->Preferences->Version Control(Team)->Git->Configuration->Add Entry

  5. 添加自己的GitHub邮箱、用户名,Apply and Closeimage-20210925163608768

创建hello world代码

  1. 创建一个Java的projectimage-20210925163820670

  2. 取一个名字,finishimage-20210925164221485

  3. 创建一个classimage-20210925164317331

  4. 取一个名字,finishimage-20210925164418717

  5. hello world代码

    public class helloworld {
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		System.out.println("hello");
    	}
    }
    

创建本地仓库

1.Team->Share progectimage-20210925164707288

  1. 如图->finishimage-20210925165110053
  2. Team->Commitimage-20210925165223041
  3. 将需要提交文件加入Indeximage-20210925165520938
  4. 在Commit Message随便写一点修改了什么,然后提交image-20210925165651655

push到GitHub的仓库

1.Team->Remote->Pushimage-20210925165758859

2.用之前的Local Path(就是克隆到本地的GitHub仓库)填入image-20210925170418178

3.image-20210925170606948

由GitHub上传

  1. 修改情况已经能从GitHub客户端查看
  2. 点击Publish branch上传image-20210925172333075
  3. GitHub上就有上传的代码啦image-20210925172504738
posted @ 2021-09-25 17:27  Star_tears  阅读(38)  评论(0)    收藏  举报