【環境】
- Eclipse for windows
【目的】
- 透過 Eclipse 的 plugin(jgit) 來存取 Github 所提供的服務。
【Pre-requisites】
- 請先行安裝好 Eclipse for Windows
- 準備好 Git on Windows
- 先行註冊好你的 GitHub account(http://github.com/)
【步驟】
- Install jGit
- Navigate to Help | Install new software
Press Add
* Name:Git
* Location: http://www.jgit.org/update-site - Press Ok
- Navigate to Help | Install new software
- RSA key generation
- Download and Install utility - "Git on Windows"
* Select "Use Git Bash only"
* http://msysgit.googlecode.com/files/Git-1.6.4-preview20090730.exe - Navigate to Start | Git | GitBash
* key generation
$ cd ~/.ssh
$ ssh-keygen -t rsa -C "your_email@where.com"
* Press "Enter" to left empty passphrase
* Press "Enter" again - Copy your key to the ssh fle dirory
(Skip this step, 如果你的eclipse ssh key檔和 ~/.ssh 是一樣的)
* for example
$ cp * ~/ssh - Add your rsa key to github
* IE讀取 github網頁有點問題,建議用 Mozilla Firefox
* 可參考 http://help.github.com/msysgit-key-setup/ - Restart Eclipse(must)
- Debug, 用git帳號探測
$ ssh git@github.com
- Download and Install utility - "Git on Windows"
- Import Project/Files to Eclipse from GitHub
- Navigate to File | Import | Git | Git Repository
* Press "Next" - Fill in your github information
* Location git@...
* Protocal: git+ssh
* User: git
Press "Next" - Disable radio button "Import projects after clone"
Press "Finish"
- Navigate to File | Import | Git | Git Repository
- Create a new project
- File | New | Project | General | Project...
- 把之前import 的檔案放在Project下
- Commit to Local/GitHub
- Navigate to Team | share project
- 先commit到local
* Team | Add
* Team | Commit - commit 到github要用push to
* Select Project
* Team | Push to | Next
* Select "Configured remote repository", Press "Next"
* Press "Add all branches spec"
* Press "Finish"
* 成功的話會有一個 Status Repo
- 參考
- http://itcontent.blogspot.com/2009/04/windowseclipse-git.html
- authfail 參考: http://www.chengyunfeng.com/tag/git
- Generating SSH keys (Linux) http://help.github.com/linux-key-setup/