Eclipse Zone is brought to you in partnership with:

Mitch Pronschinske is the Lead Research Analyst at DZone. Researching and compiling content for DZone's research guides is his primary job. He likes to make his own ringtones, watches cartoons/anime, enjoys card and board games, and plays the accordion. Mitch is a DZone Zone Leader and has posted 2578 posts at DZone. You can read more from them at their website. View Full User Profile

Git in Eclipse

06.23.2010
| 15210 views |
  • submit to reddit
With today's release of Helios (Eclipse 3.6), the developers of EGit and JGit have finalized (a week early) version 0.8.4 for the Eclipse platform update.  The incubating Git support in Eclipse was ranked #2 among new 3.6 platform additions by developer Ian Bull.  EGit committer Chris Aniszczyk of Red Hat also answered some questions about supported features.

A quick introduction: EGit is the new Eclipse Team provider of the Git DVCS.  It's goal is to implement most, if not all, relevant Eclipse tooling on top of their Git implementation for Eclipse.  That implementation is JGit.

JGit is a light, pure-Java library for implementing Git and its repository access routines, network protocols, and core version control algorithms.  JGit is the same implementation used for NBGit, the NetBeans implementation of Git.  The EDL-licensed JGit has very few dependencies so that it can be embedded in any Java application.  JGit can be consumed in a Maven build and there are also multiple artifacts available for various application requirements:
  <repositories>
<repository>
<id>jgit-repository</id>
<url>http://download.eclipse.org/jgit/maven</url>
</repository>
</repositories>

<!-- Core Library -->
<dependencies>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>0.8.4</version>
</dependency>
</dependencies>

<!-- Smart HTTP Servlet -->
<dependencies>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit.http.server</artifactId>
<version>0.8.4</version>
</dependency>
</dependencies>

<!-- AWT UI Helpers -->
<dependencies>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit.ui</artifactId>
<version>0.8.4</version>
</dependency>
</dependencies>

<!-- JUnit Test Support -->
<dependencies>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit.junit</artifactId>
<version>0.8.4</version>
</dependency>
</dependencies>

The JGit and EGit teams have written extensive documentation on these two technologies.  Eclipse.org has also rolled out Git infrastructure for the community to use.  Here are a few screenshots of EGit in action:

History View


Repository View


And this is a list of features officially supported in EGit versus typical command line usage:


Be aware that EGit 0.8.x is still considered beta and the project is still in incubation.  I'm sure that won't stop many of the Eclipse-using Git-lovers out there who love to be on the bleeding edge, but I just thought I'd share.  Those who are familiar with the Git CLI should be able to quickly understand how the tooling works.  EGit 0.9 is planned for September along with the Eclipse 3.6 SR1.  The next release should leave it's beta label behind and "contain the last missing pieces needed for mass adoption of Git within the Eclipse community," according to Chris Aniszczyk.

Images from Chris Aniszczyk and Ian Bull's blogs.