图解Eclipse提交项目到GitHub上
1、登录github,选择 new repository。
2、在Eclipse中new project 比如:Test项目。
3、右击"Test"->Team->share project... ->select a repository type:Git,如下图所示:
4、勾选 Use or create repository in parent folder of project,如下图所示:点击 潮贾篡绐Create Repository -> Finish这时候打开在workspace中的Test目录会发现多了一个.git文件夹。
5、右击"Test"->Team->commit 本地提交。
6、再右击"Test"->Team->Remote->Push,如下图所示:
7、URI就是github上面指定的地址,如下图所示:username和password就是github网站的用户名和密码。
8、点击finish,source ref 选择 refs/heads/master destination ref会自动填充,点击 Add Spec勾选Focus updat,开始提交,如下图所示:
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,