图解Eclipse提交项目到GitHub上

2026-03-08 08:15:12

1、登录github,选择 new repository。

2、在Eclipse中new project  比如:Test项目。

3、右击"Test"->Team->share project...  ->select a repository type:Git,如下图所示:

图解Eclipse提交项目到GitHub上

4、勾选  Use or create repository in parent folder of project,如下图所示:

点击  Create Repository  ->  Finish这时候打开在workspace中的Test目录会发现多了一个.git文件夹。

图解Eclipse提交项目到GitHub上

5、右击"Test"->Team->commit 本地提交。

6、再右击"Test"->Team->Remote->Push,如下图所示:

图解Eclipse提交项目到GitHub上

7、URI就是github上面指定的地址,如下图所示:

username和password就是github网站的用户名和密码。

图解Eclipse提交项目到GitHub上

8、点击finish,source ref 选择 refs/heads/master  destination ref会自动填充,点击  Add Spec勾选Focus updat,开始提交,如下图所示:

图解Eclipse提交项目到GitHub上

9、可以刷新网页查看提交的代码了,如下图所示:

注:在Eclipse中生public key, 并添加到GitHub Repository中在菜单栏依次打开window → preference → general → network connection → SSH2 → Key Management → generate RSA Key... → apply → save private key...

生成 SSH 的 public key在GitHub中通过:edit your profile -> ssh key -> Add SSH Key 添加SSH Key, 

图解Eclipse提交项目到GitHub上

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢