git GitSharp 与 NGit

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5994205/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 05:28:11  来源:igfitidea点击:

GitSharp vs NGit

c#.netgitgitsharpngit

提问by serega

What is the current state of GitSharpand NGitand which one is better suited for Git automation from .NET?

GitSharpNGit的当前状态是什么,哪一个更适合 .NET 的 Git 自动化?

回答by nulltoken

  • GitSharp (at least, its Core) was a manual, line by line, port of JGit. Its development has currently been paused since August 2010. However, some products still rely on it (e.g. Git-dot-aspx).

  • NGit is an automated port of JGit. It keeps on being updated against JGit and continuously benefits from JGit improvements and bug fixes. NGit is currently used to bring Git features to MonoDevelop.

  • GitSharp(至少,它的核心)是一本手册,一行一行,JGit 的端口。自 2010 年 8 月以来,它的开发目前已暂停。但是,一些产品仍然依赖它(例如Git-dot-aspx)。

  • NGit 是 JGit 的一个自动化端口。它不断针对 JGit 进行更新,并不断从 JGit 改进和错误修复中受益。NGit 目前用于将 Git 功能引入 MonoDevelop

Performance wise, cloning a huge repository (Mono or Linux, for instance) with GitSharp was a long and painful experience. I haven't tried with NGit though.

在性能方面,使用 GitSharp 克隆一个巨大的存储库(例如 Mono 或 Linux)是一个漫长而痛苦的经历。我还没有尝试过 NGit。

Considering those facts, from a support/maintenance perspective, I would suggest you to use NGit over GitSharp.

考虑到这些事实,从支持/维护的角度来看,我建议您使用 NGit 而不是 GitSharp。

EDIT:

编辑:

GitSharp web site now states

GitSharp 网站现在声明

GitSharp development is currently on hold because we believe that the libgit2 project and its C# bindings libgit2sharpare far more promising to work on.

GitSharp 的开发目前暂停,因为我们相信 libgit2 项目及其 C# 绑定 libgit2sharp更有前途。

回答by manojlds

I have used GitSharp a bit, and it was good enough even a year back. I think the activity on GitSharp is reduced, but I think it is a much better implementation. I don't like that NGit is an automated port from JGit to a large extent, including some of its dependencies ( GitSharp uses SharpSSH, whereas NGit uses NSch, a port of JSch ) . That will mean there can be some sub-optimal performance and other issues, but I haven't used NGit, so I cannot back my claim.

我曾经使用过 GitSharp,一年前它已经足够好了。我认为 GitSharp 上的活动减少了,但我认为这是一个更好的实现。我不喜欢 NGit 在很大程度上是 JGit 的自动化端口,包括它的一些依赖项(GitSharp 使用 SharpSSH,而 NGit 使用 NSch,JSch 的一个端口)。这意味着可能存在一些次优性能和其他问题,但我没有使用过 NGit,所以我无法支持我的主张。

回答by linquize

GitSharp is more high level, the low level part is implemented in GitSharp.Core GitSharp has .NET style, while NGit is too Javaish. Currently, commands such as Commit, Tag have not been implemented in GitSharp, while these ha ve been implemented in NGit.

GitSharp 更高级,低级部分在 GitSharp.Core 中实现 GitSharp 具有 .NET 风格,而 NGit 则过于 Javaish。目前,GitSharp 中还没有实现 Commit、Tag 等命令,而 NGit 中已经实现了这些命令。

Personally, I prefer GitSharp, as it provides a pure .NET implementation. NGit is semi-automatically ported with larger set of libraries (JSch, Sharpen) but it is still pure .NET. Pure .NET dlls (AnyCPU) ease deployment!!! libgit2sharp is just the wrapper for C library and we have to deploy the C library as well. Deployment for C libraries is more trouble to target many platforms and architectures (x86, x64, Windows, Linux)

就个人而言,我更喜欢 GitSharp,因为它提供了纯 .NET 实现。NGit 与更大的库集(JSch、Sharpen)半自动移植,但它仍然是纯 .NET。纯 .NET dll (AnyCPU) 易于部署!!!libgit2sharp 只是 C 库的包装器,我们也必须部署 C 库。C 库的部署针对许多平台和体系结构(x86、x64、Windows、Linux)更麻烦

回答by linquize

Since GitSharp project is out of sync from upstream jgit, we have to switch to NGit which sync with latest jgit at regular interval. To make GitSharp project alive, large efforts are required.

由于 GitSharp 项目与上游 jgit 不同步,我们必须切换到与最新 jgit 定期同步的 NGit。为了让 GitSharp 项目活跃起来,需要付出巨大的努力。

The lower level NGit.dll can replace GitSharp.Core.dll The higher level GitSharp.dll can be ported to interface NGit.dll instead.

较低级别的 NGit.dll 可以替代 GitSharp.Core.dll 较高级别的 GitSharp.dll 可以移植到接口 NGit.dll 中。