我正在考虑构建一个与git有密切联系的应用程序。
有可用的语言绑定吗?如果有,哪些是最全面的?
这是否意味着要使用裸机C?
或者perl / python / php / C#有一组完整的绑定?
谢谢
丹尼尔
发布于 2010-10-28 03:18:31
在某些编程语言中使用Git有三种不同的方法:
不同语言的Git的
- [**JGit**](http://www.eclipse.org/jgit/) which is reimplementation of Git in Java (used among others by [EGit](http://www.eclipse.org/egit/), the [Eclipse](http://www.eclipse.org/) Git plugin, and [Gerrit Code Review](http://code.google.com/p/gerrit)),
- [**Grit**](http://grit.rubyforge.org/) is Ruby library for extracting information from a git repository in an object oriented manner, which includes a _partial_ native Ruby implementation. Used e.g. by GitHub.
- [GitSharp](http://www.eqqon.com/index.php/GitSharp) which is remplemantation of Git in C# for .NET and Mono, and which is following JGit wrt. functionality,
- [Dulwich](http://samba.org/~jelmer/dulwich/) which is pure-Python read-write implementation of the Git file formats and protocols.
- [Git::PurePerl](http://p3rl.org/Git::PurePerl) is pure Perl interface to Git repositories (it was mostly based on Grit, initially).
- [Glip](http://fimml.at/glip) is "git library in PHP" - pure PHP implementation. Used by its author for eWiki.
- [NGit](https://github.com/mono/ngit) .NET port of JGit used by Monodevelop重新实现的问题是它们并不总是实现完整的功能,有时还会错误地实现它。另一方面,它们是原生的,实现了良好的性能;它们的许可可能与Git的C(原始)实现不同,后者是GPLv2。
- The [Git.pm](http://repo.or.cz/w/git.git/tree/HEAD:/perl) module distributed with git (and used by some of its commands), [Git::Wrapper](http://p3rl.org/Git::Wrapper) and [Git::Repository](http://p3rl.org/Git::Repository) wrap git commands for Perl.
- [JavaGit](http://javagit.sourceforge.net/) is a Java API that provides access to git repositories via calling git commands.
- [GitPython](http://gitorious.org/git-python) is a Python library used to interact with Git repositories, by calling the Git executables and parsing output.
- [hs-libgit](http://github.com/vincenthz/hs-libgit/) is Haskell wrapper for git.包装器的问题是它们可能很慢(它们需要派生git进程),并且它们需要安装git才能工作。
还要注意的是,git本身是高度可脚本化的(例如,使用shell脚本),这要归功于这样一个事实,即除了针对最终用户的高级命令(瓷器)之外,它还提供了针对脚本(管道)的低级命令。
- [libgit2](http://libgit2.github.com/) itself is a portable, pure C implementation.
- [Rugged](http://github.com/libgit2/rugged) - Ruby bindings.
- [php-git](http://github.com/libgit2/php-git) - PHP bindings.
- [luagit2](http://github.com/libgit2/luagit2) - Lua bindings.
- [GitForDelphi](http://github.com/libgit2/GitForDelphi) - Delphi bindings.
- [libgit2sharp](http://github.com/libgit2/libgit2sharp) - .NET bindings.
- [pygit2](http://github.com/libgit2/pygit2) - Python bindings.
- [Geef](http://github.com/schacon/geef) is a simple Erlang NIF that exposes some of the libgit2 library functions to Erlang. Monodevelop uses a .NET port for JGit Libgit2是一个相当新的项目;它正在进行中,所以并不是所有的东西都在实现中。详情请参见libgit2 homepage。
所有这些信息都可以在Git Wiki的页面上找到
发布于 2010-10-28 02:04:45
您可以尝试不使用API。git被构造为一套不同抽象级别的实用程序。您应该能够构建一组全面的实用程序,这些实用程序通过调用这些实用程序并处理它们的输出来工作。许多高级git命令都是shell脚本或perl脚本,它们就是这样做的,所以在git源代码中有很多示例可以用作示例。
下面是一些很好的例子:
<代码>H19tig: C,适用于git的文本模式历史记录浏览器。<代码>H210<代码>F211
发布于 2010-10-28 01:04:09
这取决于你想要什么,从外观上看,你对C/C#最熟悉。Git是用C语言编写的,所以如果你想要速度,也许你应该使用它。但是,如果您希望代码清晰且易于编写,那么GitSharp可能是更好的选择。
https://stackoverflow.com/questions/4034962
复制相似问题