Git - Eclipse 提交工程至 GitHub

1. 在 GitHub 新建一个工程 hello-world,repository 地址是 https://github.com/username/hello-world.git

 

2. 在 Eclipse 新建一个工程 hello-world

 

3. 选择工程右键 -> Team -> Share Project... -> 选择 Git -> Next

 

4. 勾选 Use or create repository in parent folder of project

 

5. 选中 Project 后,点击 Create Repository,Finish

 

6. 工程目录下生成 .git 目录。

 

7. 选中工程右键 -> Team -> Commit... -> 编写注释,选择所有文件 -> Commit

 

8. 选中工程右键 -> Team -> Remote -> Push... -> URI 填 repository 地址 -> 填写用户名密码 -> Next

 

7. Source ref 选择 refs/heads/master -> 点击 Add Spec 

 

9. 勾选 Force Update -> Finish

 

10. 提交成功。

 

11. 刷新 GitHub 页面可以看到提交的代码。

 

 

posted on 2016-11-04 16:12  huey2672  阅读(177)  评论(0编辑  收藏  举报