Wednesday, August 3, 2011

Tips for using EGit and GitHub

EGit is an Eclipse plugin for working with Git repositories.  Here are a few tips based on my recent experience.

  • Install Egit from the Indigo update site (http://download.eclipse.org/releases/indigo), it's under the Collaboration subgroup.
  • Create the repository in GitHub first.  Then use the EGit "Git Repositories" view in Eclipse to create a local clone (there's a button to do this in the upper right-hand corner of the view).  Creating the repository in GitHub first helps ensure that pushing and pulling between your local clone and the main GitHub repository is straight-forward.
  • When cloning the repository, use the HTTP repository link provided in your GitHub dashboard.  If you stick with HTTP, it seems you can avoid the laborious process of installing the Git binaries on your local machine, setting up SSH keys, etc.
  • You can then add an existing Eclipse project to the repository through Team > Share Project > Git.