1. 右键项目,选择Team->Share Project…,点击Use or create repository in parent folder of project,点击Create Repository,之后在点击Finish。这时候项目会建立一个本地的git文件夹,每次提交项目之后会先提交到这个git文件夹中,
    Eclipse提交项目至Github
  2. 右键项目,选择Team->Commit,之后会显示Git Staging的信息,填写Commit Message之后点Commit
    Eclipse提交项目至Github
    此时可能出现There are no staged files的问题
    Eclipse提交项目至Github
    在Preferences->Team->Git->Committing中取消Use staging View to commit instead of Commit Dialog的选择,在重新执行Team->Commit
    Eclipse提交项目至Github
  3. 填写项目的相关信息,点击commit即可提交到本地git服务器
    Eclipse提交项目至Github
  4. 右键项目Team->Remote->Push…,之后弹出github的url信息,Location是填写项目的github地址,填写完url剩下两个会自动填充,Connection是链接端口信息,可以默认不填写,Authentication就是你自己的github账号密码,可以勾选Store in Secure Store保存账户信息,最后点击next继续
    Eclipse提交项目至Github
  5. 接下来填写项目的分支信息,说明这次提交要提交到哪一个分支上面去,选择好之后点击Add Spec,在生成的Specifications中勾选Force Update,点击Finish完成提交,此时刷新github页面就能看到提交上去的内容了
    Eclipse提交项目至Github

相关文章: