In this post I’m going to explain how to install and configure the EGit plugin for Eclipse and how to clone an existing project from a Git repository in a web based hosting service, in my case Assembla.
We assume that you already have a hosting service account and that you’ve uploaded your public key file and that there is a project to clone.
So let’s start step by step. First of all, open Eclipse and go to “Help/Install New Software…” and type “http://download.eclipse.org/releases/indigo/” in the text box to the right of “Work with:” text.
Press Add and then you will see a list of categories of installable software. Inside Collaboration category press Eclipse EGit and the Next, Next, and Finish.
After restart Eclipse, copy the git URI that you hosting service tells you for the project, it should look something like this: “email@example.com:PROJECTNAME.git”. In this case is “assembla” but it’s depends on your hosting name.
Now open up a new perspective of the “Git Repository Exploring” and press the button “Clone a Git repository”. It should already get the URI from your clipboard and fill everything out for you, so just press Next, Next, and Finish and… Voila! You have downloaded your project.
Now we have to import the downloaded project to our workspace in order to start to work with it. So just go to Eclipse “File/Import…”, now select “Git/Projects from Git” and press Next. You’ll see the downloaded folder, press Next and now choose “Import existing project” and select the project that you want to import then Next and Finish.
And that’s it! If everything went well you have your project ready for compile and have fun!
To Commit, just right-click your project and select Team/Commit.
For pushing to your remote repository, go Team/Push and set it up when doing this the first time – Click next on the first screen, nothing to see here. On the next screen, choose “master [branch]” and “Add spec” next to it. Close it off with next and then finish.
And that’s all. I hope that you find it useful and if you have any doubt don’t hesitate to contact me.