Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confusion in choosing between JavaGit, JGit and EGit

I am making a Java application that uses Git. I found that there is something called JavaGit, EGit and JGit.

I know that JavaGit and EGit/JGit are different. What I don't understand is the difference between EGit and JGit. Both are hosted on Eclipse projects but one seems to be Eclipse related and the other not.

I don't use Eclipse and I don't plan to, so I really don't care much about "Eclipse integration".

Is JGit somehow connected to Eclipse? (It is hosted on www.eclipse.org, and the documentation of JGit also has a lot of "eclipse" keywords inside)

Out of the three, what will I need to connect my Java program (not written in Eclipse) to work with Git repositories?

I would prefer a standalone Git library (i.e., without depending on a local Git installation)

EDIT: One more question:

  • Does JGit support Git bundle command?

EDIT: I found the answer -- it does (haven't tried it yet). It is in transport package in a class called BundleWriter

like image 354
Jus12 Avatar asked Mar 17 '11 06:03

Jus12


People also ask

Does JGit require Git?

Yes, that's exactly the point of JGit: it's a pure Java implementation of Git, which can be easily used from JVM applications or libraries. That's only half the truth, jgit might behave differently if you have git installed. Most git filter are executed via command line.

What is EGit?

EGit is an Eclipse Team provider for the Git version control system. Git is a distributed SCM, which means every developer has a full copy of all history of every revision of the code, making queries against the history very fast and versatile.


2 Answers

You can use JGit as standalone library, but, as mentioned in the JGit Homepage:

JGit can be found within:
* EGit, Eclipse team provider for Git

In that sense, JGit is connected to Eclipse in that EGit uses JGit features to develop the Eclipse Git plugin.
Considering all Eclipse projects are now versioned in Git repos (instead of previously CVS repos), I would consider JGit for your Java project, as it seems that:

  • JavaGit isn't updated for quite some time (2008)
  • Eclipse is committed to offer a good support for Git through EGit, which should ensure by extension the development of JGit (used by EGit).

Thorbjørn Ravn Andersen comments:

Even though you say that Egit uses JGit, it is not quite clear in the above that EGit is an Eclipse plugin for git giving git support in the same way that CVS is already supported in Eclipse

The migration of Eclipse projects from CVS to Git is in progress, and has been reported here (by Chris Aniszczyk).

I’ve monitored conversations concerning the migration of project code from CVS to Git in the dev-lists of several projects.
Most developers, it seems, understand the value proposition of migrating, despite their concerns that with migration comes a whole lot of new learnin’ as they figure out how to say productive in the new environment.

Inevitably, discussion about the team provider for Git being developed by the EGit project becomes an prominent part of the conversation. “Is EGit ready for primetime?” is often the question that bounced around

The official bug illustrated Eclipse commitment to provide "adequate tooling support" for all Eclipse projects now on Git repo is the bug 293192.

In order to deprecate old VCS in favour of git (bug 270854), adequate tooling should be available. This bug is created to track that.
[...] I opened/linked relevant EGit bugs in order to have a better visibility/tracking of what's missing.

So Egit is the only project referenced in that bug to provide said adequate tooling support for the new (D)VCS chosen for all Eclipse projects.

(bug 270854 is about Deprecate old VCS tools, which includes essentially CVS.)


Just in (March 17th, 2001): The State of Git at Eclipse – Early 2011 (Chris Aniszczyk):

I’m happy that things have come quite a long way since last year based on Eclipse Marketplace stats and the community contributions the projects have received.

EGit installation rate

So what’s next? In terms of tooling, we’re getting closer to our 1.0 release (which is planned for the Indigo release).
The git tooling at Eclipse is much better these days, if you need help or have questions, please start with the most excellent EGit User Guide.

If you’re an eclipse.org project, please consider starting the process to move your project repository to Git. There are a lot of eclipse.org projects already on Git.
It would be nice to see the all of the eclipse.org projects have plans to move to Git by the Indigo release.

like image 133
VonC Avatar answered Oct 06 '22 01:10

VonC


As one of the authors of JGit and EGit, sorry for the confusion.

JGit is an EDL (new-style BSD) licensed, lightweight, pure Java library implementing the Git version control system. It can be used in a standalone fashion and is embedded in applications such as Gerrit, Eclipse, Netbeans and IntelliJ. EGit embeds JGit to use it to work with Git repositories and expose Git constructs from within Eclipse. At the moment, JGit doesn't support the git-bundle command but you're welcome to contribute support, it shouldn't be that hard, please see our contributor guide.

like image 39
Chris Aniszczyk Avatar answered Oct 06 '22 00:10

Chris Aniszczyk