Eclipse提交项目到GitHub上

说明:高版本eclipse开发工具自带Git插件(免安装)

  1. 查看eclipse是否已安装git插件
    window->preferences
    team-git
    查看是否有git配置项;
    不存在请安装后操作哦!
  2. 上传本地工程
    右击”项目名称”->Team->share project… ->select a repository type:Git,如下图所示
    仓库类型我们选择Git

  3. 创建本地仓库
    3.1 Creation of repositories in the Eclipse workspace is not recommended
    警告:不建议在Eclipse工作区中创建存储库
    这里写图片描述
    3.2 点击create按钮,我们自己创建一个.git文件仓库
    这里写图片描述
    3.3 勾选要上传的工程项目如下图
    这里写图片描述
    Path winth repository 为仓库内文件,建议创业一个本项目的父级文件,便于后期管理整洁!
    点击完成功能按钮,本地仓库创建成功。
    3.4 此时回到工程,项目会如下所示,文件前面会出现‘?’字样,代表着要被提交哦
    这里写图片描述

  4. 上传工程代码到本地仓库
    右键”项目名称”->Team->Commit (Ctrl+#)
    这里写图片描述
    说明:Author:用户名 <邮箱>(提交者的用户名和邮箱)
    Committer: 用户名 <邮箱>
    commmit 完成本地仓库上传操作!

  5. 上传工程代码到远程github仓库
    输入目的地仓库位置Enter the location of the destination repository.
    5.1 Location位置
    URI:远程仓库路径
    Host:github.com:根据自动填入
    Repository path:根据uri自动填入
    5.2 Connecton连接
    Protocal:选择传输协议为https
    Port:不用填
    5.3 Authenticaton认证
    User:远程仓库用户名
    Password:远程仓库密码
    Store in Secure Store 保存密码
    这里写图片描述

  6. 配置push规则
    6.1 选择 source ref:refs/heads/master
    6.2 点击+Add Spec
    6.3 在Specifications for push
    勾选Force Update(强制更新到github仓库中)
    这里写图片描述
    finish

  7. 推送结果 push result
    这里写图片描述

  8. 登录github查看
    这里写图片描述
    恭喜,完成!

猜你喜欢

转载自blog.csdn.net/u012637358/article/details/80110477