Kevin Quillen

Laughing. Coding. Rocking. Ranting.

Working With EGit, Eclipse, and Beanstalk

| Comments

Working with Git can be a joy. To be super quick and efficient in a development team, it should be a part of your workflow. For some, the command line can be a scary place, and with the wrong kind of access, a simple command mistake might cause havoc on your local machine or development server.

Not to worry. EGit is a plugin for the Eclipse IDE that can hook into Git repositories. By being directly in front of you as you code, it also promotes integrated workflow, with Git commands just a right-click away.

If you work on a hosted Gitservice like GitHub or Beanstalk, you might encounter this small bug (feature?) of EGit in its current version (0.9.3). Even though you use msysgit to generate ssh- rsa key for authentication, EGit looks in the wrong spot for it. The generated key finds its way in the folder you saved it to, but EGit will look in your Documents and Settings/users/(your account)/ssh, which is a problem for authentication via Eclipse, since the key won’t be there.

Here is how I got it working:

  1. Generate your ssh key with msysgit.
  2. Authenticate to your git repo (ex. Beanstalk, where ‘account’ is your subdomain): ssh git@account.beanstalkapp.com
  3. Accept the connection and continue
  4. Copy the files from .ssh into ssh folder (mine was C:\Documents and Settings\kevin.ssh and ssh)
  5. Open id_rsa.pub and copy the key into your profile at your Git service (Beanstalk, GitHub, etc)
  6. Start Eclipse
  7. Install EGit, if you haven’t already
  8. Open Git Repositories view, select Clone from Repository
  9. Copy public git URL in, don’t select protocol, don’t enter authentication options (leave default values)

This is what it took to get started with Beanstalk. It might vary with GitHub. I notice that some other pages list having git+ssh as a protocol option; I however do not have that (only git and ssh seperate, not sure why). Anyone know?

Hopefully this is resolved in a future version of EGit. Seems to only affect Windows users. I suppose you could also save the ssh key in ssh instead of the default .ssh, but I have not tried that.

Comments