【Eclipse】Plugin: jgit with Github


【環境】

  • Eclipse for windows

【目的】

  • 透過 Eclipse 的 plugin(jgit) 來存取 Github 所提供的服務。

Pre-requisites

  • 請先行安裝好 Eclipse for Windows
  • 準備好 Git on Windows
  • 先行註冊好你的 GitHub account(http://github.com/)

【步驟】

  1. Install jGit
    1. Navigate to Help | Install new software
      Press Add
      * Name:Git
      * Location: http://www.jgit.org/update-site
    2. Press Ok
  2. RSA key generation
    1. Download and Install utility - "Git on Windows"
      * Select "Use Git Bash only"
      * http://msysgit.googlecode.com/files/Git-1.6.4-preview20090730.exe
    2. 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
    3. Copy your key to the ssh fle dirory
      (Skip this step, 如果你的eclipse ssh key檔和 ~/.ssh 是一樣的)
      * for example
      $ cp * ~/ssh
    4. Add your rsa key to github
      * IE讀取 github網頁有點問題,建議用 Mozilla Firefox
      * 可參考 http://help.github.com/msysgit-key-setup/
    5. Restart Eclipse(must)
    6. Debug, 用git帳號探測
      $ ssh git@github.com 
  3. Import Project/Files to Eclipse from GitHub
    1. Navigate to File | Import | Git | Git Repository
      * Press "Next"
    2. Fill in your github information
      * Location git@...
      * Protocal: git+ssh
      * User: git
      Press "Next"
    3. Disable radio button "Import projects after clone"
      Press "Finish"
  4. Create a new project
    1. File | New | Project | General | Project...
    2. 把之前import 的檔案放在Project下
  5. Commit to Local/GitHub
    1. Navigate to Team | share project
    2. 先commit到local
      * Team | Add
      * Team | Commit
    3. 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
  6. 參考
    1. http://itcontent.blogspot.com/2009/04/windowseclipse-git.html
    2. authfail 參考: http://www.chengyunfeng.com/tag/git
    3. Generating SSH keys (Linux) http://help.github.com/linux-key-setup/
 

Ed32. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com