eclipse連接github

@轉自 http://www.cnblogs.com/kungfupanda/p/5675216.html

1.在https://github.com   new repository

2.在eclipse中new project  比如:Test項目

3.右擊"Test"->Team->share project...  ->select a repository type:Git


勾選  Use or create repository in parent folder of project


點擊  Create Repository  ->  Finish 這時候打開在workspace中的Test目錄會發現多了一個.git文件夾。
4.右擊"Test"->Team->commit 本地提交

5.再右擊"Test"->Team->Remote->Push


URI就是github上面指定的地址: username和password就是github網站的用戶名和密碼

5.填寫完畢後,點擊finish


6. source ref 選擇 refs/heads/master  destination ref會自動填充,點擊  Add Spec勾選Focus update 開始提交。
7.可以刷新網頁查看提交的代碼了。。。

注:在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, 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章