GitSharp vs NGit

16.1k views Asked by At

What is the current state of GitSharp and NGit and which one is better suited for Git automation from .NET?

4

There are 4 answers

4
nulltoken On BEST ANSWER
  • 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.

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.

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

EDIT:

GitSharp web site now states

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

0
linquize On

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.

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)

1
linquize On

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.

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

0
manojlds On

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.