JavaGit、JGit 和 EGit 之间选择的困惑
我正在制作一个使用 Git 的 Java 应用程序。我发现有一种东西叫做 JavaGit, EGit 和 JGit。
我知道 JavaGit 和 EGit/JGit 是不同的。我不明白的是 EGit 和 JGit 之间的区别。两者都托管在 Eclipse 项目上,但其中一个似乎与 Eclipse 相关,而另一个则不然。
我不使用 Eclipse,也不打算使用,所以我真的不太关心“Eclipse 集成”。
JGit 是否以某种方式连接到 Eclipse? (它托管在 www.eclipse.org 上,JGit 的文档也有很多里面的“eclipse”关键字)
在这三个中,我需要什么来连接我的 Java 程序(不是用 Eclipse 编写的)来使用 Git 存储库?
我更喜欢一个独立的 Git 库(即,不依赖于本地 Git 安装)
编辑:还有一个问题:
- JGit 是否支持 Git 捆绑命令?
编辑:我找到了答案——确实如此(尚未尝试过)。它位于 transport
包中名为 BundleWriter
的类中
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您可以使用 JGit 作为独立库,但是,正如 JGit 主页 中提到的:
从这个意义上说,JGit 连接到 Eclipse,因为 EGit 使用 JGit 功能来开发 Eclipse Git 插件。
考虑到所有 Eclipse 项目现在都在 Git 存储库(而不是以前的 CVS 存储库)中进行版本控制,我会考虑将 JGit 用于您的 Java 项目,因为看起来:
Thorbjørn Ravn Andersen 评论:
Eclipse 项目的迁移 从 CVS 到 Git 正在进行,以及 已在此处报告(由 Chris Aniszczyk)。
说明 Eclipse 官方错误承诺为 Git 存储库上的所有 Eclipse 项目提供“足够的工具支持”是 错误 293192。
因此,Egit 是该 bug 中唯一引用的项目,为所有 Eclipse 项目选择的新 (D)VCS 提供足够的工具支持。
(bug 270854 是关于弃用旧的 VCS 工具,其中主要包括 CVS。)
刚刚发布(2001 年 3 月 17 日):Eclipse 中的 Git 状态 – 2011 年初 (
You can use JGit as standalone library, but, as mentioned in the JGit Homepage:
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:
Thorbjørn Ravn Andersen comments:
The migration of Eclipse projects from CVS to Git is in progress, and has been reported here (by Chris Aniszczyk).
The official bug illustrated Eclipse commitment to provide "adequate tooling support" for all Eclipse projects now on Git repo is the bug 293192.
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):
作为 JGit 和 EGit 的作者之一,对于造成的混乱表示抱歉。
JGit 是一个 EDL(新式 BSD)许可、轻量级、纯 Java 库,实现了 Git 版本控制系统。它可以独立使用,也可以嵌入到 Gerrit、Eclipse、Netbeans 和 IntelliJ 等应用程序中。 EGit 嵌入 JGit 以使用它来处理 Git 存储库并从 Eclipse 中公开 Git 构造。目前,JGit 不支持 git-bundle 命令,但欢迎您提供支持,这应该不难,请参阅我们的贡献者指南。
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.
只是为了插话,因为我刚才偶然发现了这个问题。
Eclipse Foundation 和 Eclipse IDE 之间存在差异。基金会是伞式组织,而 IDE 是通过基金会开发的项目之一。因此,需要了解的重要一点是,正如 Apache 始于 Web 服务器并扩展到托管多个项目的基金会一样,Eclipse 基金会现在也已扩展到 IDE 之外的“根源”。
因此,在这种情况下,JGit 代码为 git 命令提供 Java API,而 EGit 使用 JGit 为 Eclipse IDE 提供 git 支持。
就我个人而言,我有时也发现这有点令人困惑,有时似乎发生了这么多事情在某种程度上降低了这些组织的焦点;然而,我也看到了拥有一个伞式组织而不是 20 个类似但不同的组织的实用性。
Just to chime in, as I just stumbled on this this question just now.
There is a difference between the Eclipse Foundation and the Eclipse IDE. The Foundation is the umbrella organization, while the IDE is one of the projects developed through the foundation. So, the important thing to know is that just as Apache started with the web server and branched out to become a Foundation hosting a number of projects, so has the Eclipse Foundation now expanded beyond its "roots" in the IDE.
So in this context the JGit code provides a Java API for git commands, while EGit uses JGit to provide git support for the Eclipse IDE.
Personally, I also find this a little confusing at times, and sometimes it almost seems that having so much going on has in some ways degraded the focus of these organizations; however I can also see the utility in having one umbrella organization instead of 20 similar but different organizations.
JGit 是作为 Java 库从头开始实现的 git,而 JavaGit 是(曾经?)包装本机 git 实现的 Java API(即它调用本机 git 命令行)。
EGit 是 Git Eclipse 团队提供商,将 JGit 集成到 Eclipse IDE 中,并提供从 Eclipse 内部使用 Git 的 UI。
与此同时,Eclipse 社区的很大一部分以及大量的企业开发人员正在使用 EGit/JGit(这就是支持这些项目的公司投入资金的原因)。请参阅项目页面 ([1]、[2]) 和 ohloh 如果您想了解谁在贡献。
JGit is git implemented from scratch as a Java library whereas JavaGit is (was ?) a Java API wrapping the native git implementation (i.e. it's calling the native git command line).
EGit is the Git Eclipse Team Provider integrating JGit into the Eclipse IDE and is providing the UI to work with Git from inside Eclipse.
In the meantime a large part of the Eclipse community and also a large number of corporate developers is using EGit/JGit (that's the reason why the companies backing these projects put money into that). See the project pages ([1], [2]) and ohloh if you want to get some insight who is contributing.
JGit 是 Git 的 Java 实现。它是一个库,也可以在您自己的应用程序中使用。它还提供某种 CLI 操作。
另一边的EGit是Eclipse团队提供的Git插件,它使用JGit作为Git实现。简单来说,EGit 是 UI 部分,JGit 是后台部分。
JGit 不依赖于 EGit,但 EGit 确实依赖于 JGit。
来自: https://www.eclipse.org/forums/index.php /t/273443/
JGit is the Java implementation of Git. It is a library, that also can be used in your own applications. It also provides some sort of CLI operations.
EGit on the other side is the Eclipse team provider plugin for Git, which uses JGit as Git implementation. Simplified you could say EGit is the UI part, and JGit the background part.
JGit doesn't depend on EGit, but EGit does depend on JGit.
From: https://www.eclipse.org/forums/index.php/t/273443/
JGit 是一个操作 git 存储库的库。您不会单独使用 JGit,除非您编写一个程序以您喜欢的方式操作 git 存储库。
如果您使用 Eclipse 作为 IDE,则安装 EGit 作为版本控制插件(Indigo 中默认)。 EGit 调用 JGit,因此如果您安装 EGit,您也安装了 JGit。
请注意,对于 Netbeans,您将 NBGit 作为版本控制插件安装。 NBGit 也称为 JGit。
JavaGit:没有积极维护?
JGit is a library to manipulate git repository. You do not use JGit alone, unless you write a program to manipulate git repository in the way you like.
If you use Eclipse as the IDE, you install EGit as a version control plugin (defaulted in Indigo). EGit calls JGit so you also have JGit installed if you install EGit.
Note, for Netbeans, you install NBGit as a version control plugin. NBGit also calls JGit.
JavaGit: not actively maintained?