Wednesday, March 27, 2013

XP-Dev.com, Eclipse, and GIT

I wanted to use Eclipse with GIT and XP-Dev.com on Windows 7. Turns out this is more of a pain that I had originally imagined so I've written it here for future reference - and perhaps to help anyone else having this pain.

It didn't matter what I tried I couldn't get the HTTPS URL provided by xp-dev.com to work, which leaves us with SSH. I won't bother with all the other things I tried, but these steps finally worked.

Prerequisites

GIT (and the GIT Bash)
Eclipse
EGIT
An XP-Dev account

Steps

  1. Open Git Bash.
  2. Type ssh-keygen and press enter to all the questions. Make a note of where the file is saved.
  3. Open the file and copy the pass key but not the other stuff to your clipboard. That means everything in-between the "ssh-rsa" and your "username@computer".
  4. The folder path that the file is dumped to is the same file path that's in Eclipse's Preferences, General -> Network Settings -> SSH2 [SSH2 Home].
  5. Go to XP-Dev.com, select Dashboard, then "account" at the top right.
  6. Select "View Profile In Detail".
  7. Under "Add a New Public Key" give the key a name (doesn't matter what), then paste the key and save it. Any error messages means you copied the wrong part of the key (see step 3).
  8. Go back to your Git Bash.
  9. Type ssh @xp-dev.com. It should tell you "all shell logins disabled". That's fine because it means we at least got authenticated. 
  10. Go to the project in Eclipse you want hosted at XP-Dev.com.
  11. Make sure that this project is in it's own local GIT repository. If it isn't already, then follow the EGIT Getting Started Guide.
  12. Select Team->Remote->Push...
  13. Enter the URL which should be something like: ssh://@git.xp-dev.com/. Enter your password and select Next.
  14. Enter the other details that you want to push - I just selected [master - branch] under Source Ref, and then "Add Spec" and Finish.
  15. Hope it all works!

One Other Thing Of Note

  • I added the file generated in step 3 to the list of private key settings in Eclipse's Preferences, General -> Network Settings -> SSH2, but I don't believe I should have or it makes a difference. However, I'm not taking it out now it works.

1 comment: