创建新的repository

使用Eclipse提交代码到GitHub

创建完成,记住创建好的这个地址:https://github.com/le1024/test.git

使用Eclipse提交代码到GitHub

将本地项目上传到git
高级版本的eclipse自带git,如果eclipse没有需要安装git插件

1. 对创建好的项目右键,Team >Share Project,选择Git,然后Next

使用Eclipse提交代码到GitHub

2. 先把User or create repository in parent folder of project勾选上,再点击Create Repository,点击Finish

使用Eclipse提交代码到GitHub

3.会看到刚刚的那个项目文件都带有?

使用Eclipse提交代码到GitHub

4. 右键项目,Team >Add to Index,之后项目文件带有+号,不需要提交的项目文件,可以右键项目Team > Remove from Index

使用Eclipse提交代码到GitHub

5. 提交项目到本地仓库,右键项目Team >Commit
使用Eclipse提交代码到GitHub

项目代码提交到git,右键项目Team >Remote >Push
URI:输入一开始在git创建repository的地址:https://github.com/le1024/test.git
输入你的git的登录名和密码,Next

使用Eclipse提交代码到GitHub

使用Eclipse提交代码到GitHub

然后Next, Finish

去刷新您的git页面,查看是否上传成功

使用Eclipse提交代码到GitHub

相关文章: