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


Eclipse+Github+"hello world"(简单清楚)
    • 下载链接
    • 安装
    • Github仓库
      • 创建一个GitHub仓库
      • GitHub客户端
    • Eclipse
      • 安装EGit插件
      • 创建hello world代码
      • 创建本地仓库
      • push到GitHub的仓库
      • 由GitHub上传
  • Eclipse Downloads | The Eclipse Foundation

  • Github账号注册:GitHub

  • Github客户端下载:GitHub Desktop | Simple collaboration from your desktop

  • Java下载jdk:Java Archive Downloads - Java SE 8 (oracle.com)

  • jdk、Eclipse、Github客户端下载下来
  • 全默认无脑下一步安装完成
  • 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