Eclipse Git plugin installation
Like a lot of Rails developers who have been spoiled by the excellent Eclipse plugins for Subversion, I was disappointed by the lack of equivalent plugins for Git. In fact, the only one that I found was Egit. Unfortunately, its documentation is a bit weak. And for someone who is not a Java guru, Eclipse guru and/or a mind reader, the installation instructions are really weak. But I was desperate. And once I dove in, it turned out to not be that difficult.
Assumptions (most directly from Egit’s sparse installation guide):
- You have git installed and working correctly
- I have version 1.5.5.4
- You can see your version from the command line with git –version
- You have Eclipse installed and working correctly
- I use Europa, version 3.3.2
- From within Eclipse you can see your version with Eclipse | About Eclipse SDK (OSX) or Help | About (Windows).
- Java Runtime Environment (JRE) version 6 or 1.5.0_11 or later available
- My MacBook Pro came pre-installed with version 1.5.0_13
- You can see which version you have from the command line with java -showversion -it’s at the top. But that only shows one JRE version, and…
- Because it’s possible to have multiple JREs installed, you should also check your Eclipse preferences to make sure you have an appropriate version available from within Eclipse. You can see the JRE Interpreters with Java > Installed JREs. The checked JRE is the default, but the Egit plugin only cares that a suitable version is available.
The installation steps are pretty straightforward:
- Clone (or otherwise acquire) the Egit source and put it somewhere. I used this command: git clone git://repo.or.cz/egit.git
- Inside the Egit source are several Eclipse projects, each in a directory whose name starts with “org.spearce.” You need to add these projects into your Eclipse environment -but only temporarily. You can add them from the File | Import menu option in Eclipse. Then select General > Existing Projects into Workspace. From the dialog box browse to the directory holding the Egit source that you acquired in step one above. You should then see the eight Eclipse projects “org.spearce.<something>.” Make sure they are all selected and choose “Finish.”
- Each project should build automatically, but in case you have somehow disabled automatic building, manually build the Egit projects from the Project menu.
- Next, you’re going to create an Eclipse plugin from the built projects:
- From the Project Explorer (or Ruby Explorer) view, select (highlight) all eight Egit projects
- Choose File | Export from the Eclipse menu
- Choose Plug-in Development > Deployable plug-ins and fragments. If you don’t see the Plug-In Development section,you need to enable the Development capability in the Eclipse Preferences (General > Capabilities).
- Select “Next” and in the resulting “Export” dialog, make sure you have selected all five available Plug-ins and fragments
- Browse to the root directory of your Eclipse installation. On OSX, the directory is typically Applications/Eclipse. Under Windows, I would expect something like C:\Program Files\Eclipse or C:\Eclipse.
- Select “Finish”
- Now that you have added the Egit plugin, you need to restart Eclipse to enable it.
You’re done.
Add Git features to an existing project from the “Team” menu.
Issues:
- Where are all the pretty decoration icons for git status? All I have are nasty ‘>’ characters.
June 29th, 2008 at 14:09
[…] Chris Cruft » Blog Archive » Eclipse Git plugin installation git clone git://repo.or.cz/egit.git […]
July 24th, 2008 at 11:29
[…] the installation instructions for eGit, I found a nice quick guide on Chris Cruft’s blog, here. It’s excellent in guiding you through the process of compiling an Eclipse plugin from […]
December 21st, 2008 at 2:20
[…] - Eclipse Git plugin installation […]
December 31st, 2008 at 2:19
[…] 21-12-2008 NetBeans IDE 6.5 Beta for PHP Developers Saved by favoriteangel on Thu 18-12-2008 Chris Cruft » Blog Archive » Eclipse Git plugin installation Saved by flarestart on Tue 16-12-2008 partial eclipse Saved by wikilious on Tue 16-12-2008 […]
February 27th, 2009 at 13:12
I followed these steps with my Eclipse App and it worked fine. But, when I try to do it in Flex Builder 3, it doesnt give me the Export Plugin option. I tried the pref, general, capabilities. But, that wasnt there either. I also tried, building and exporting from Eclipse to my Flex Builder Directory and stil nothing. Any suggestions?
March 6th, 2009 at 13:49
Turns out it was a limited version of eclipse pdt. I just downloaded Eclipse classic and it gave me my options