Prerequisites

Show Eclipse views

In Eclipse, open the Git Repositories and Git Staging views.

  1. Select Window -> Show View -> Other Window menu
  2. Select Git -> Git Repositories / Git Staging Show View dialog

Clone GitHub repository

  1. Open the repository on GitHub.com.
  2. Under the green Code button, copy the SSH URI. It might be necessary to click the SSH button. The SSH URI begins with git@github.com:. GitHub SSH URI
  3. In the Eclipse Git Repositories view, select the Clone button. The Clone button has a green arrow and a tooltip that reads “Clone a Git Repository and add the clone to this view”. Clone button
  4. Select Clone URI as the Repository Source.
  5. In the Clone Git Repository dialog, Eclipse usually reads the URI from the clipboard and inserts it into the URI box. If this did not happened automatically, paste the URI into the URI box. All other fields complete automatically. The User is git and the Password is blank (since authentication is by SSH). Clone Git Repository dialog
  6. Click Next until the Local Destination step (at the top of the dialog box). If this is the first time this user account on this computer has connected to GitHub via SSH, a couple of messages regarding keys may appear. Selecting the check boxes prevents the messages from appearing again.
  7. At the Local Destination step, make sure the option Import all existing Eclipse projects after clone finishes is checked. Local Destination step

The repository appears in the Git Repositories view. Repository in Git Repositories view

The project appears in the Package Explorer view. Project in Package Explorer view

Fix missing project in Package Explorer view

If the repository appears in the Git Repositories view but the project does not appear in the Package Explorer view, the Import all existing Eclipse projects after clone finishes checkbox was likely left unchecked.

Import the project from an existing GitHub repository.

  1. Select File -> Import.
  2. Select Git -> Projects from Git.
  3. Select Existing local repository.
  4. Select the repository that was just cloned in the step above.
  5. Click Next/Finish for the remaining steps.

Comments

Comment on Get Eclipse project from GitHub